https://www.nginx.com/blog/using-free-ssltls-certificates-from-lets-encrypt-with-nginx/
____REPLACE_ME_WITH_YOUR_OWN_DOMAIN____
= Replace with your domain__PROJECT_FOLDER__
= Replace with the path to the folder for the project__STATIC_FOLDER_PATH__
= Replace with the path to the folder for static files__MEDIA_FOLDER_PATH__
= Replace with the path to the folder for media files__SOCKET_NAME__
= Replace with your unix socket name
server {
listen 80;
listen [::]:80;
server_name ____REPLACE_ME_WITH_YOUR_OWN_DOMAIN____;
client_max_body_size 10M;
# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html index.php;
# ATTENTION: __STATIC_FOLDER_PATH__
location /static {
autoindex on;
alias __STATIC_FOLDER_PATH__;
}
# ATTENTION: __MEDIA_FOLDER_PATH__
location /media {
autoindex on;
alias __MEDIA_FOLDER_PATH__;
}
# ATTENTION: __SOCKET_NAME__
location / {
proxy_pass http://unix:/run/__SOCKET_NAME__;
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;
}
# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
deny all;
}
location ~ /\. {
access_log off;
log_not_found off;
deny all;
}
gzip on;
gzip_disable "msie6";
gzip_comp_level 6;
gzip_min_length 1100;
gzip_buffers 4 32k;
gzip_proxied any;
gzip_types
text/plain
text/css
text/js
text/xml
text/javascript
application/javascript
application/x-javascript
application/json
application/xml
application/rss+xml
image/svg+xml;
access_log off;
#access_log /var/log/nginx/____REPLACE_ME_WITH_YOUR_OWN_DOMAIN____-access.log;
error_log /var/log/nginx/____REPLACE_ME_WITH_YOUR_OWN_DOMAIN____-error.log;
}