gogs.conf 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. ##
  2. # You should look at the following URL's in order to grasp a solid understanding
  3. # of Nginx configuration files in order to fully unleash the power of Nginx.
  4. # http://wiki.nginx.org/Pitfalls
  5. # http://wiki.nginx.org/QuickStart
  6. # http://wiki.nginx.org/Configuration
  7. #
  8. # Generally, you will want to move this file somewhere, and start with a clean
  9. # file but keep this around for reference. Or just disable in sites-enabled.
  10. #
  11. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  12. ##
  13. # Default server configuration
  14. #
  15. upstream gogs {
  16. server gogs-service-dockerbunker:3000;
  17. }
  18. server {
  19. listen 80;
  20. server_name ${SERVICE_DOMAIN};
  21. return 301 https://$host$request_uri;
  22. }
  23. server {
  24. listen 443;
  25. server_name ${SERVICE_DOMAIN};
  26. ssl on;
  27. ssl_certificate /etc/nginx/ssl/${SERVICE_DOMAIN}/cert.pem;
  28. ssl_certificate_key /etc/nginx/ssl/${SERVICE_DOMAIN}/key.pem;
  29. include /etc/nginx/includes/ssl.conf;
  30. add_header Strict-Transport-Security "max-age=15768000; includeSubDomains";
  31. add_header X-Frame-Options DENY;
  32. add_header X-Content-Type-Options nosniff;
  33. include /etc/nginx/includes/gzip.conf;
  34. location / {
  35. proxy_pass http://gogs/;
  36. }
  37. location ~ /.well-known {
  38. allow all;
  39. root /var/www/html;
  40. }
  41. }