Skip to content

Instantly share code, notes, and snippets.

@thanhleviet
Created July 3, 2012 15:30
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 4 You must be signed in to fork a gist
  • Save thanhleviet/3040490 to your computer and use it in GitHub Desktop.
Save thanhleviet/3040490 to your computer and use it in GitHub Desktop.
Setting up proxy for geoserver with nginx
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