0

I am running 2 geoserver and nginx container. I want to call https://xxx.xxx.com/geoserver the other one https://xxx.xxx.com/geoserver2. The geoserver containers are running behind proxy container. This is default domain.com/geoserver configuration.


location /geoserver {
add_header           Front-End-Https    on;
add_header  Cache-Control "public, must-revalidate";
add_header Strict-Transport-Security "max-age=2592000; includeSubdomains";
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_set_header X-Forwarded_For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://geoserver_geoserver_1:8080/geoserver;
}

How can i call domain.com/geoserver2 I was trying some configuration but when i tried login, the domain redirect geoserver_geoserver_1 this container. but geoserver2 should be running geoserver_geoserver_2 this container.

location /geoserver2/ {
    add_header           Front-End-Https    on;
    add_header  Cache-Control "public, must-revalidate";
    add_header Strict-Transport-Security "max-age=2592000; includeSubdomains";
    proxy_set_header Host $http_host;
    proxy_set_header X-Forwarded-Proto $scheme;
    proxy_set_header X-Forwarded_For $proxy_add_x_forwarded_for;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_pass http://geoserver_geoserver_2:8080/geoserver/;
    proxy_redirect   /geoserver /geoserver2;
}
djdomi
  • 1,377
  • 3
  • 10
  • 19
  • 1
    Does this answer your question? [Nginx reverse proxy + URL rewrite](https://serverfault.com/questions/379675/nginx-reverse-proxy-url-rewrite) – djdomi Apr 15 '22 at 17:22
  • Hello. Thanks for your return. I have tried but it did not work. I would like to call geoport instead of geoserver. – nginxfault Apr 16 '22 at 11:39
  • its still not clear yet what is the goal. please update the question that anyone can understand your needs – djdomi Apr 17 '22 at 16:56

0 Answers0