Schlagwörter: nginx docker
-
AutorBeiträge
-
-
27. September 2021 um 12:46 Uhr - Views: 768 #11958
Good Morning,
How can I choose the default page?
Now if I click on supporto.XXXXXX.it, the customer user is automatically redirected on agent page. I’d like automatically redirect the customer on customer page (otobo/customer.pl).
I have tryed to change FQDN in otobo system but doesn’t works fine.
Now DNS are configured as http://www.supporto.XXXXX.it.
Thank You
-
28. September 2021 um 10:07 Uhr #11960
Good Morning,
I’d like modify nginx file configuration because I make customer page as default.
I have installed otobo with docker-compose but I don’t find the nginx configuration file.
Where can I find it?
How can I modify it?
Thank You
-
28. September 2021 um 15:25 Uhr #11962
Hi Giordiano,
we are thinking about making this easier, especially as AFAIK this was a simple SysConfig setting in OTRS 6. Fpr now we recomment a bit more convoluded way. The default page can indeed be set in the nginx configuration. Doing this in the running works, but your changes would be lost after a restart of the container. Therefore the config should be changed in a volume, which will persist when the container is stopped and started again.
See https://doc.otobo.org/manual/installation/stable/en/content/installation-docker.html#custom-configuration-of-the-nginx-webproxy for how to create the custom config.
In the file otobo_nginx.conf.template you can then add something like:
location = / {
return 301 otobo/customer.pl
}
location / { … same as before … }Please give feedback when the works, or doesn’t work, for you. I’ll add it then as an example the documentation.
-
28. September 2021 um 16:17 Uhr #11963
Thank You.
I will try it….:-)
-
28. September 2021 um 17:24 Uhr #11965
I have tryed but it doesn’t work fine.
I have added but nothing
Thank You
-
28. September 2021 um 22:39 Uhr #11966
Hi Giordiano,
from the screenshots I gather that you have created a volume and that you have adapted the custom config file. Did you also adapt the file .env ? If yes, you can check your Nginx container.
bes:~/devel/OTOBO/otobo-docker (rel-10_0)$ docker exec -it otobo_nginx_1 bash
root@e1ce50e91562:/etc/nginx# more /etc/nginx/config/template-custom/otobo_nginx.conf.template
more: stat of /etc/nginx/config/template-custom/otobo_nginx.conf.template failed: No such file or directory
root@e1ce50e91562:/etc/nginx# exit
exitbes:~/devel/OTOBO/otobo-docker (rel-10_0)$
In my installation I don’t have a custom config installed. But you should see your adapted config. If the custom config looks fine and the redirect still does not work you can try first to restart the container.
docker-compose restart nginx
Good luck,
Bernhard
-
29. September 2021 um 9:30 Uhr #11967
Good Morning Bernhard,
I have followed these setting, too….
After setting up the volume, the adapted configuration must be activated. The new volume is set up in docker-compose/otobo-nginx-custom-config.yml. Therefore this file must be added to COMPOSE_FILE. Then Nginx must be directed to use the new config. This is done by setting NGINX_ENVSUBST_TEMPLATE_DIR in the environment. In order to achieve this, uncomment or add the following lines in your .env file:
COMPOSE_FILE=docker-compose/otobo-base.yml:docker-compose/otobo-override-https.yml:docker-compose/otobo-nginx-custom-config.yml
NGINX_ENVSUBST_TEMPLATE_DIR=/etc/nginx/config/template-customI’m trying this setting on my VM…
You can see my configuration…
I have tryed restart nginx service, but it doesn’t work fine…:-(
-
29. September 2021 um 10:30 Uhr #11968
Hi Giordiano,
one thing I noticed in your config is that the redirect is set up for a prefix match on ‚/‘. It propably should be an exact match as set up by
location = / { ... }
.Also I’m not sure how the problem manifests itself. Is nginx not starting up? Or is only the redirect not working? Are there error messages in the nginx log. The log can be inspected with
docker-compose logs nginx
.Best regards,
Bernhard
-
29. September 2021 um 10:52 Uhr #11969
Only redirect isn’t working.
I have corrected in location.
I don’t find docker-compose logs…
-
29. September 2021 um 12:18 Uhr #11970
Ah, this time you need to run the command on the Docker host, not in the Docker image. Specifically you must run
docker-compose logs nginx
in the directory otobo-docker. as that command needs the information from the file .env. -
29. September 2021 um 12:28 Uhr #11971
:-(
-
29. September 2021 um 14:45 Uhr #11973
Now I’m confused. The service web is obviously running, but nginx isn’t. The .env file with
COMPOSE_FILE=docker-compose/otobo-base.yml:docker-compose/otobo-override-https.yml:docker-compose/otobo-nginx-custom-config.yml
looks ok too.
Do you have other changes that might break things? What does
git diff
say? What doesdocker-compose ps
say? -
29. September 2021 um 16:55 Uhr #11977
I haven’t changed anything….
-
29. September 2021 um 17:47 Uhr #11978
OK, we are getting closer. The service nginx is not running. This means that access via https://localhost/otobo/index.pl should not work. I just saw that in your first mail you mention http://www.supporto.XXXXX.it. But because you mentioned nginx I just assumed that you are running with SSL support.
The first question is whether you need, or want, SSL support. Both scenarios are supported.
- SSL support is wanted: your .env file seems to be strange. Could you run
diff .env .docker_compose_env_https
and mask out the sensitive parts? - SSL support is not wanted: nginx is not needed at all. Replace ‚otobo/index.pl‘ with ‚otobo/customer.pl‘ around line 445 in the file /opt/otobo/bin/psgi-bin/otobo.psgi which is available in the container web. As a sanitiy check you can also do a
diff .env .docker_compose_env_http
In one of the next releases of OTOBO we plan to make this much more simple. See https://github.com/RotherOSS/otobo/issues/1279.
- SSL support is wanted: your .env file seems to be strange. Could you run
-
30. September 2021 um 10:27 Uhr #11982
Good Morning Bes,
yes I have two otobo, one is VM localhost for testing other is production version.
In production version we have SSL and I configure it with default https template.
-
30. September 2021 um 12:53 Uhr #11983
Hello Giordano,
this clarifies things. As you are not using SSL in your test installation, you are also not using nginx there. Subsequently, any changes to the nginx config won’t have any effect.
It makes perfect sense to test config changes first in the test system. This can be achieved by using nginx in the test system as well. This can be achieved by basing the .env in your test system on .docker_compose_env_https and to activate a custom nginx config. You can choose whether you want to add certificates to your test installation. The alternative would be to change the
listen
directives in otobo_nginx.conf.template in order to support only HTTP.Best regards,
Bernhard
-
-
AutorBeiträge
- Du musst angemeldet sein, um auf dieses Thema antworten zu können.