Nginx Notes
Home |
Table of Contents
1 Resources
https://www.digitalocean.com/community/users/erikaheidi
How To Install Linux, Nginx, MySQL, PHP (LEMP stack) on Ubuntu 20.04
2 Nginx Proxy/Forward example config
# Virtual Host configuration for example.com # # You can move that to a different file under sites-available/ and symlink that # to sites-enabled/ to enable it. # server { listen 80; listen [::]:80; server_name example.com www.example.com; # SSL configuration # listen 443 ssl; listen [::]:443 ssl; ssl_certificate /etc/nginx/ssl/2019/example_com.chained.crt; ssl_certificate_key /etc/nginx/ssl/2019/example.com.2048.key; location / { proxy_pass http://172.17.0.10:80; 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 https; proxy_set_header X-Forwarded-Port 443; proxy_set_header Host $host; # Fix error: # upstream sent too big header while reading response header from upstream proxy_buffer_size 128k; proxy_buffers 4 256k; proxy_busy_buffers_size 256k; #proxy_set_header Ssl-Offloaded 1; #proxy_set_header DBG-SSL 1; #fastcgi_param HTTPS on; } }