nginx-ssl.sample.conf 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. upstream backend {
  2. server 127.0.0.1:9999; # Change to the port you specified on lolisafe
  3. }
  4. server {
  5. listen 80;
  6. listen [::]:80;
  7. server_name lolisafe.moe;
  8. return 301 https://$server_name$request_uri;
  9. }
  10. server {
  11. listen 443 ssl http2;
  12. listen [::]:443 ssl http2;
  13. server_name lolisafe.moe;
  14. ssl_certificate /path/to/your/fullchain.pem;
  15. ssl_certificate_key /path/to/your/privkey.pem;
  16. ssl_trusted_certificate /path/to/your/fullchain.pem;
  17. client_max_body_size 100M; # Change this to the max file size you want to allow
  18. location / {
  19. add_header Access-Control-Allow-Origin *;
  20. root /path/to/your/uploads/folder;
  21. try_files $uri @proxy;
  22. }
  23. location @proxy {
  24. proxy_set_header X-Real-IP $remote_addr;
  25. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  26. proxy_set_header Host $http_host;
  27. proxy_set_header X-NginX-Proxy true;
  28. proxy_pass http://backend;
  29. proxy_redirect off;
  30. proxy_http_version 1.1;
  31. proxy_set_header Upgrade $http_upgrade;
  32. proxy_set_header Connection "upgrade";
  33. proxy_redirect off;
  34. proxy_set_header X-Forwarded-Proto $scheme;
  35. }
  36. }