Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to modify the internal URL? #135

Open
automatix opened this issue Apr 7, 2021 · 4 comments
Open

How to modify the internal URL? #135

automatix opened this issue Apr 7, 2021 · 4 comments

Comments

@automatix
Copy link
Contributor

automatix commented Apr 7, 2021

Hi,

(Context: Windows 10.)

I was a bit unhappy with the naming and changed some names, e.g. the log files names or the database name. I'm going to create a PR later. Anyway, the last station on this road was the URL. So I changed the value of the server.server_name configuration in the symfony.conf from "symfony.localhost" to "app.loc". Then

$ docker-compose down && docker-compose build && docker-compose up -d

But no effect. The container can still be found under symfony.localhost. OK, then I removed all containers, images, volumes, and networks, cleared the build cache, executed docker system prune (which is actually not needed, when all the objects have already been removed by running specific commands -- but just in case).

$ docker container stop $(docker container ls -aq)
$ docker container rm $(docker container ls -aq)
$ docker image prune -a
$ docker volume prune
$ docker network prune
$ docker builder prune
$ docker system prune

Then I rebuilt and started the containers again.

$ docker-compose down && docker-compose build && docker-compose up -d

But I still cannot reach the application under the new address. And the old one is still working. How is it possible? How to get the change applied?

@automatix
Copy link
Contributor Author

Resolved... ) I forgot to change the entry in the hosts of my host system:

127.0.0.1			app.loc

Now it works.

@automatix
Copy link
Contributor Author

I'm reopening this issue, since there is still one thing, I cannot explain to myself:

The new address app.loc only wokrs, if it's registered in the hosts file. The old address works independently of the hosts. I can register it there, can remove, can set the address to -- the old one works in every case. Why? Is there a kind of cache? And why doesn't it work for the new address the same way?

@automatix automatix reopened this Apr 7, 2021
@eko
Copy link
Owner

eko commented May 2, 2021

Hi @automatix,

I think this is because the symfony.localhost server name is hard coded into the nginx configuration here: https://github.com/eko/docker-symfony/blob/master/nginx/symfony.conf#L2

Maybe we could use server_name _; to have a catch-all domain names (see: http://nginx.org/en/docs/http/server_names.html).

@ricfio
Copy link
Contributor

ricfio commented May 2, 2021

Hi @eko,
is there any reason why nginx is not configured to serve the symfony application directly as the default server?
If this were possible it would no longer be necessary to modify the hosts file !

PS
Could be useful customizing the server_name (currently hard coded) on nginx configuration symfony.conf ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants