Sorry for making so many threads, but finding it easier for asking for help in each thread. I’ve been working on this for over 24 hours… and I just… well, can’t seem to figure it out.
So rather than explaining my issue. I was wondering if someone could tell me what exactly to put into the reverse proxy container server file, and what to include in the web container nginx server file.
Here’s one of my current nginx proxy server file:
server {
listen 80 proxy_protocol;
listen [::]:80 proxy_protocol;server_name xxxxxxx;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://ipofthewebcontainer;
}real_ip_header proxy_protocol;
set_real_ip_from 127.0.0.1;listen [::]:443 proxy_protocol ssl ipv6only=on; # managed by Certbot
listen 443 proxy_protocol ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/xxxxxxx/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/xxxxxxx/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbotadd_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Referrer-Policy “origin”;ssl_stapling on;
ssl_stapling_verify on;
}
and the nginx site config I use on the web container that includes my forums:
server {
listen 80 proxy_protocol;
listen [::]:80 proxy_protocol;server_name xxxxxxx;
location / {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_pass http://ipofthewebcontainer;
}real_ip_header proxy_protocol;
set_real_ip_from 127.0.0.1;listen [::]:443 proxy_protocol ssl ipv6only=on; # managed by Certbot
listen 443 proxy_protocol ssl; # managed by Certbot
ssl_certificate /etc/letsencrypt/live/xxxxxxx/fullchain.pem; # managed by Certbot
ssl_certificate_key /etc/letsencrypt/live/xxxxxxx/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbotadd_header Strict-Transport-Security "max-age=31536000; includeSubDomains; preload";
add_header X-Frame-Options SAMEORIGIN;
add_header X-Content-Type-Options nosniff;
add_header X-XSS-Protection "1; mode=block";
add_header Referrer-Policy “origin”;ssl_stapling on;
ssl_stapling_verify on;
}
Can someone tell me if this is the proper way to do it? And where I have to include any additional nginx server code, such as friendly urls? On the nginx reverse proxy or nginx web container? Trying to learn to make this work… but after working for it for the past 24 hours is getting tiresome.
I’ve been using How to Set Up a Reverse Proxy to Host Websites in LXD | Linode Docs as a guideline. But the guide lacks information on how to properly set up the web container nginx server file as a whole as it only explains the basics and only shows a nginx reverse proxy example file.