site.conf 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. server {
  2. listen 443 ssl spdy;
  3. server_name https.cio.gov;
  4. ssl_certificate /etc/nginx/ssl/keys/https.cio.gov.chained.crt;
  5. ssl_certificate_key /etc/nginx/ssl/keys/https.cio.gov.key;
  6. include ssl/ssl.rules;
  7. error_page 404 /404/index.html;
  8. error_page 500 /500/index.html;
  9. location / {
  10. root /home/site/production/current/_site;
  11. default_type text/html;
  12. }
  13. # production hook runs on port 4000
  14. location /deploy {
  15. proxy_pass http://localhost:4000/;
  16. proxy_http_version 1.1;
  17. proxy_redirect off;
  18. proxy_set_header Host $host;
  19. proxy_set_header X-Real-IP $remote_addr;
  20. proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
  21. proxy_set_header X-Forwarded-Proto https;
  22. proxy_max_temp_file_size 0;
  23. proxy_connect_timeout 10;
  24. proxy_send_timeout 30;
  25. proxy_read_timeout 30;
  26. }
  27. access_log /home/site/production/nginx_access.log main;
  28. error_log /home/site/production/nginx_error.log;
  29. }
  30. # redirect for those clients not preloaded with https.cio.gov
  31. server {
  32. listen 80;
  33. server_name https.cio.gov;
  34. return 301 https://https.cio.gov$request_uri;
  35. }