website_nginx.conf 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # Upstream component nginx needs to connect to.
  2. upstream django {
  3. server unix:///opt/h0v1n8-website-env/website/website.sock; # For production file socket
  4. #server 127.0.0.1:8001; # Web port socket for use with uwsgi-hello-world-test.py
  5. }
  6. server {
  7. listen 80 default_server;
  8. listen [::]:80 default_server;
  9. server_name _;
  10. return 301 https://h0v1n8.nl/$request_uri;
  11. }
  12. # Configuration of the server
  13. server {
  14. # the port your site will be served on
  15. listen 443 ssl;
  16. # the domain name it will serve for
  17. server_name h0v1n8.nl www.h0v1n8.nl; # substitute your machine's IP address or FQDN
  18. ssl_certificate /etc/letsencrypt/live/h0v1n8.nl/fullchain.pem;
  19. ssl_certificate_key /etc/letsencrypt/live/h0v1n8.nl/privkey.pem;
  20. charset utf-8;
  21. # max upload size
  22. client_max_body_size 75M; # adjust to taste
  23. # Django media
  24. #location /media {
  25. # alias /path/to/your/mysite/media; # your Django project's media files - amend as required
  26. #}
  27. location /static {
  28. alias /srv/www/static; # your Django project's static files - amend as required
  29. }
  30. # Finally, send all non-media requests to the Django server.
  31. location / {
  32. uwsgi_pass django;
  33. include /opt/h0v1n8-website-env/uwsgi_params; # the uwsgi_params file you installed
  34. }
  35. }