Skip to content

Instantly share code, notes, and snippets.

@mcnemesis
Created July 12, 2023 10:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mcnemesis/f824840ef5eec745d880bf2ac6163d55 to your computer and use it in GitHub Desktop.
Save mcnemesis/f824840ef5eec745d880bf2ac6163d55 to your computer and use it in GitHub Desktop.
Sample Nginx Server Config for Serving Django App running on hidden/local network Apache instance with/without SSL
# OUR SERVER
server {
listen 80;
server_name .domain.com;
return 301 https://domain.com$request_uri;
}
server {
listen 443;
ssl_certificate_key /etc/letsencrypt/live/domain.com/privkey.pem;
ssl_certificate /etc/letsencrypt/live/domain.com/fullchain.pem;
ssl on;
server_name domain.com;
proxy_set_header Host $host;
client_max_body_size 100M;
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
location / {
proxy_pass http://127.0.0.1:8888/;
proxy_cache off;
}
location ~ /favicon.png {
root /var/www/;
}
location ~ /favicon.ico {
root /var/www/;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment