https _SSL_ template (django-gunicorn.stpl)
This commit is contained in:
56
django-gunicorn.stpl
Normal file
56
django-gunicorn.stpl
Normal file
@@ -0,0 +1,56 @@
|
||||
#=========================================================================#
|
||||
# Django + Gunicorn Socket SSL Template for HestiaCP
|
||||
#=========================================================================#
|
||||
server {
|
||||
listen %ip%:%proxy_ssl_port% ssl http2;
|
||||
server_name %domain_idn% %alias_idn%;
|
||||
|
||||
ssl_certificate %ssl_pem%;
|
||||
ssl_certificate_key %ssl_key%;
|
||||
ssl_stapling on;
|
||||
ssl_stapling_verify on;
|
||||
|
||||
root %docroot%;
|
||||
index index.html;
|
||||
|
||||
access_log /var/log/%web_system%/domains/%domain%.log combined;
|
||||
access_log /var/log/%web_system%/domains/%domain%.bytes bytes;
|
||||
error_log /var/log/%web_system%/domains/%domain%.error.log error;
|
||||
|
||||
location ~ /\.(?!well-known\/) {
|
||||
deny all;
|
||||
return 404;
|
||||
}
|
||||
|
||||
location / {
|
||||
proxy_pass http://unix:/home/%user%/web/%domain%/gunicorn.sock;
|
||||
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;
|
||||
}
|
||||
|
||||
location ~* ^.+\.(%proxy_extensions%)$ {
|
||||
try_files $uri @fallback;
|
||||
root %sdocroot%;
|
||||
expires max;
|
||||
}
|
||||
|
||||
location @fallback {
|
||||
proxy_pass http://unix:/home/%user%/web/%domain%/gunicorn.sock;
|
||||
}
|
||||
|
||||
location /static/ {
|
||||
alias %docroot%/static/;
|
||||
expires 30d;
|
||||
}
|
||||
|
||||
location /media/ {
|
||||
alias %docroot%/media/;
|
||||
expires 30d;
|
||||
}
|
||||
|
||||
include %home%/%user%/conf/web/%domain%/nginx.hsts.conf*;
|
||||
include %home%/%user%/conf/web/%domain%/nginx.ssl.conf_*;
|
||||
}
|
||||
Reference in New Issue
Block a user