nginx.conf 734 B

1234567891011121314151617181920212223242526
  1. location PATHTOCHANGE {
  2. if ($scheme = http) {
  3. rewrite ^ https://$server_name$request_uri? permanent;
  4. }
  5. try_files $uri @YNH_APP_INSTANCE_NAME;
  6. }
  7. location PATHTOCHANGE/media {
  8. alias /opt/YNH_APP_INSTANCE_NAME/media;
  9. }
  10. location PATHTOCHANGE/static {
  11. alias /opt/YNH_APP_INSTANCE_NAME/static;
  12. }
  13. location PATHTOCHANGE/assets {
  14. alias /opt/YNH_APP_INSTANCE_NAME/static;
  15. }
  16. location @YNH_APP_INSTANCE_NAME {
  17. proxy_set_header Host $host;
  18. proxy_set_header X-Real-IP $remote_addr;
  19. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  20. proxy_set_header X-Forwarded-Proto $scheme;
  21. proxy_pass http://unix:/opt/YNH_APP_INSTANCE_NAME/sock;
  22. }