-
-
Save faisal-w/28f9f1d5ee793e29d099d72d23878a14 to your computer and use it in GitHub Desktop.
Setting up proxy for geoserver with nginx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Tested on nginx version 1.1.9, ubuntu 12.04 | |
-Command lines in order: | |
sudo touch /etc/nginx/site-availables/geoserver.conf | |
sudo vi /etc/nginx/site-availables/geoserver.conf | |
sudo ln -s /etc/nginx/site-availables/geoserver.conf /etc/nginx/site-enabled/geoserver.conf | |
sudo service nginx start | |
Content of geoserver.conf | |
server { | |
listen 80; | |
server_name 192.168.243.138; | |
root /usr/share/nginx/www; | |
index index.html index.htm; | |
proxy_redirect off; | |
location /geodata { | |
include proxy_params; | |
proxy_pass http://127.0.0.1:8080/geodata; | |
} | |
} | |
Content of proxy_params (default) | |
proxy_set_header Host $host; | |
proxy_set_header X-Real-IP $remote_addr; | |
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment