Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Configuration of geoserver.conf for https reverse proxy using nginx on Ubuntu 18.04
server {
listen 80;
listen [::]:80;
if ($scheme != "https"){
return 301 https://$host$request_uri;
}
listen 443 ssl;
listen [::]:443 ssl;
ssl_certificate /etc/letsencrypt/live/example.com/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/example.com/privkey.pem;
server_name site.example.com;
root /usr/share/nginx/www;
index index.html index.htm;
proxy_redirect off;
location /geoserver {
proxy_pass http://127.0.0.1:8080/geoserver;
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