server { root /var/www/tddnetwork.org; index index.html index.htm index.nginx-debian.html; server_name tddnetwork.org www.tddnetwork.org; access_log /var/log/nginx/tddnetwork.org_access.log; error_log /var/log/nginx/tddnetwork.org_error.log; location / { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. autoindex on; autoindex_format html; autoindex_localtime on; try_files $uri $uri/ =404; } location ~* \.(?:png|mp4)$ { expires 1y; add_header Cache-Control "public"; } location /auth { # First attempt to serve request as file, then # as directory, then fall back to displaying a 404. proxy_pass http://localhost:5000; 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; } # pass PHP scripts to FastCGI server # #location ~ \.php$ { # include snippets/fastcgi-php.conf; # # # With php-fpm (or other unix sockets): # fastcgi_pass unix:/run/php/php7.3-fpm.sock; # # With php-cgi (or other tcp sockets): # fastcgi_pass 127.0.0.1:9000; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} listen [::]:443 ssl; # managed by Certbot listen 443 ssl; # managed by Certbot ssl_certificate /etc/letsencrypt/live/tddnetwork.org/fullchain.pem; # managed by Certbot ssl_certificate_key /etc/letsencrypt/live/tddnetwork.org/privkey.pem; # managed by Certbot include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot } server { if ($host = www.tddnetwork.org) { return 301 https://$host$request_uri; } # managed by Certbot if ($host = tddnetwork.org) { return 301 https://$host$request_uri; } # managed by Certbot listen 80; listen [::]:80; server_name tddnetwork.org www.tddnetwork.org; return 404; # managed by Certbot }