i have this config to access geoserver :
location /geoserver {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8080/geoserver/;
proxy_pass_header Set-Cookie;
proxy_redirect off;
}
}
every this work fine when i access geoserver webpage but nginx not handle requests like this :
http://localhost:8080/geoserver/ows?SERVICE=WMS&access_token=4r3irW5W3DboGs…7091932%2C-5009377.085697312%2C-10018754.17139462%2C-9.313225746154785e-10
this error appear in console:
GET http://localhost:8080/geoserver/ows?SERVICE=WMS&access_token=4r3irW5W3DboGs…7091932%2C-5009377.085697312%2C-10018754.17139462%2C-9.313225746154785e-10 net::ERR_CONNECTION_REFUSED
i want to nginx to replace http://localhost:8080
with IP
Update
i removed slash but some requests not working well
OPTIONS http://localhost:8080/geoserver/wms?SERVICE=WMS&REQUEST=GetCapabilities&TILED=true&VERSION=1.1.1 net::ERR_CONNECTION_REFUSED
i copied the url in browser and replaced localhost:8080
with IP it works!!!
full configrations :
upstream django {
server unix:///tmp/uwsgi.sock; # for a file socket
}
server {
listen 80;
server_name XX.XX.XX.XX;
charset utf-8;
#Max upload size
client_max_body_size 1024M; # adjust to tast
location / {
uwsgi_pass django;
include /etc/nginx/uwsgi_params;
}
location /geoserver {
proxy_set_header Host $host;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://localhost:8080/geoserver;
proxy_pass_header Set-Cookie;
proxy_redirect off;
}
}