Advertisement
Smith8154

Nginx Error

Jun 7th, 2016
1,381
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Nginx 2.05 KB | None | 0 0
  1. # You may add here your
  2. # server {
  3. #   ...
  4. # }
  5. # statements for each of your virtual hosts to this file
  6.  
  7. ##
  8. # You should look at the following URL's in order to grasp a solid understanding
  9. # of Nginx configuration files in order to fully unleash the power of Nginx.
  10. # http://wiki.nginx.org/Pitfalls
  11. # http://wiki.nginx.org/QuickStart
  12. # http://wiki.nginx.org/Configuration
  13. #
  14. # Generally, you will want to move this file somewhere, and start with a clean
  15. # file but keep this around for reference. Or just disable in sites-enabled.
  16. #
  17. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  18. ##
  19.  
  20. server {
  21.     listen 80;
  22.     listen 443 ssl;
  23.  
  24.     ssl_certificate     /etc/nginx/CERTS/websitename.net.pem;
  25.     ssl_certificate_key /etc/nginx/CERTS/websitename.net.key;
  26.  
  27.     root /var/www/html;
  28.     index index.php index.html index.htm;
  29.  
  30.     server_name websitename.net www.websitename.net;
  31.  
  32.     location / {
  33.         try_files $uri $uri/ /index.php?q=uri&$args;
  34.     }
  35.  
  36.     location ~ \.php$ {
  37.         try_files $uri =404;
  38.         fastcgi_pass 127.0.0.1:9000;
  39.         fastcgi_index index.php;
  40.         include fastcgi_params;
  41.  
  42.     }
  43.  
  44.     location = /favicon.ico {
  45.         log_not_found off;
  46.         access_log off;
  47.     }
  48.  
  49.     location = /robots.txt {
  50.         allow all;
  51.         log_not_found off;
  52.         access_log off;
  53.     }
  54.  
  55.     location ~ /\. {
  56.         deny all;
  57.     }
  58.  
  59.     location ~* /(?:uploads|files)/.*\.php$ {
  60.         deny all;
  61.     }
  62.  
  63. }
  64.  
  65. # another virtual host using mix of IP-, name-, and port-based configuration
  66. #
  67. #server {
  68. #   listen 8000;
  69. #   listen somename:8080;
  70. #   server_name somename alias another.alias;
  71. #   root html;
  72. #   index index.html index.htm;
  73. #
  74. #   location / {
  75. #       try_files $uri $uri/ =404;
  76. #   }
  77. #}
  78.  
  79.  
  80. # HTTPS server
  81. #
  82. #server {
  83. #   listen 443;
  84. #   server_name localhost;
  85. #
  86. #   root html;
  87. #   index index.html index.htm;
  88. #
  89. #   ssl on;
  90. #   ssl_certificate cert.pem;
  91. #   ssl_certificate_key cert.key;
  92. #
  93. #   ssl_session_timeout 5m;
  94. #
  95. #   ssl_protocols SSLv3 TLSv1 TLSv1.1 TLSv1.2;
  96. #   ssl_ciphers "HIGH:!aNULL:!MD5 or HIGH:!aNULL:!MD5:!3DES";
  97. #   ssl_prefer_server_ciphers on;
  98. #
  99. #   location / {
  100. #       try_files $uri $uri/ =404;
  101. #   }
  102. #}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement