Guest User

Untitled

a guest
Mar 8th, 2016
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.99 KB | None | 0 0
  1. user http;
  2. worker_processes auto;
  3.  
  4. error_log /var/log/nginx/error.log;
  5. #error_log logs/error.log notice;
  6. #error_log logs/error.log info;
  7.  
  8. #pid logs/nginx.pid;
  9.  
  10.  
  11. events {
  12. worker_connections 1024;
  13. }
  14.  
  15.  
  16. http {
  17. include mime.types;
  18. default_type application/octet-stream;
  19.  
  20. access_log /var/log/nginx/access.log;
  21.  
  22. sendfile on;
  23. #tcp_nopush on;
  24.  
  25. #keepalive_timeout 0;
  26. keepalive_timeout 65;
  27.  
  28. #gzip on;
  29.  
  30. # Add headers to serve security related headers
  31. add_header Strict-Transport-Security "max-age=15768000; includeSubDomains; preload;";
  32. add_header X-Content-Type-Options nosniff;
  33. add_header X-Frame-Options "SAMEORIGIN";
  34. add_header X-XSS-Protection "1; mode=block";
  35. add_header X-Robots-Tag none;
  36. add_header X-Download-Options noopen;
  37. add_header X-Permitted-Cross-Domain-Policies none;
  38.  
  39. server {
  40. listen 80;
  41. server_name b...;
  42. # enforce https
  43. return 301 https://$server_name$request_uri;
  44. }
  45.  
  46. server {
  47. listen 443;
  48. server_name b....;
  49.  
  50. ssl_certificate /etc/nginx/ssl/key.crt;
  51. ssl_certificate_key /etc/nginx/ssl/key.key;
  52.  
  53. #charset koi8-r;
  54.  
  55. location / {
  56. root /srv/http/;
  57. index index.php index.html index.htm;
  58. }
  59.  
  60.  
  61. # redirect server error pages to the static page /50x.html
  62. #
  63. error_page 500 502 503 504 /50x.html;
  64. location = /50x.html {
  65. root /usr/share/nginx/html;
  66. }
  67.  
  68. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  69. #
  70. location ~ \.php$ {
  71. root /srv/http;
  72. fastcgi_pass unix:/var/run/php-fpm/php-fpm.sock;
  73. fastcgi_index index.php;
  74. fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name;
  75. include fastcgi.conf;
  76. }
  77.  
  78. }
  79.  
  80. include servers-enabled/*;
  81. }
Advertisement
Add Comment
Please, Sign In to add comment