Advertisement
hotleadsingerguy

Default SSL

Apr 30th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. # Send all HTTP to HTTPS
  2. server {
  3. listen 80 default_server;
  4. server_name 127.0.0.1 192.168.1.X 192.168.1.X DOMAIN.com;
  5.  
  6. location / {
  7. #return 301 https://$server_name$request_uri;
  8. return 301 https://$host$request_uri;
  9. }
  10. }
  11.  
  12. ssl_session_cache shared:SSL:10m;
  13. ssl_session_timeout 10m;
  14.  
  15. upstream http_backend {
  16. server 192.168.1.x:8080;
  17. keepalive 16;
  18. }
  19.  
  20. #####################
  21. # DOMAIN
  22. #####################
  23.  
  24. server {
  25. listen 443 ssl http2;
  26. server_name 192.168.1.x DOMAIN.com;
  27.  
  28. root /var/www/html/x;
  29. index index.php index.html index.htm;
  30. ssl_certificate /etc/letsencrypt/live/DOMAIN.com-0002/fullchain.pem; # managed by Certbot
  31. ssl_certificate_key /etc/letsencrypt/live/DOMAIN.com-0002/privkey.pem; # managed by Certbot
  32. include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
  33.  
  34. error_log /var/log/nginx/x.log notice;
  35. client_max_body_size 64M;
  36.  
  37. add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
  38.  
  39. location ~ \.php$ {
  40. include snippets/fastcgi-php.conf;
  41. include fastcgi_params;
  42. }
  43.  
  44. location / {
  45.  
  46. }
  47. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement