====== Overview ====== [[https://www.digitalocean.com/community/tutorials/understanding-nginx-server-and-location-block-selection-algorithms|Nginx server and location block]] -- Explains matching against server and location blocks [[https://docs.nginx.com/nginx/admin-guide/web-server/reverse-proxy/|Reverse proxy]] -- Explanations and examples ====== Site configuration ====== ===== Proxy ===== ==== Owncloud/Nextcloud ==== location / { # Nextcloud spesific proxy proxy_pass_header Server; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; proxy_set_header X-Forwarded-host $host; proxy_pass_header Authorization; proxy_pass http://192.168.1.218:80; } ==== Other ==== location / { proxy_pass http://localhost:1338; proxy_http_version 1.1; proxy_set_header Upgrade $http_upgrade; proxy_set_header Connection 'upgrade'; proxy_set_header Host $host; proxy_cache_bypass $http_upgrade; }