Advertisement
Guest User

Untitled

a guest
Jan 18th, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. ##
  2. # You should look at the following URL's in order to grasp a solid understanding
  3. # of Nginx configuration files in order to fully unleash the power of Nginx.
  4. # http://wiki.nginx.org/Pitfalls
  5. # http://wiki.nginx.org/QuickStart
  6. # http://wiki.nginx.org/Configuration
  7. #
  8. # Generally, you will want to move this file somewhere, and start with a clean
  9. # file but keep this around for reference. Or just disable in sites-enabled.
  10. #
  11. # Please see /usr/share/doc/nginx-doc/examples/ for more detailed examples.
  12. ##
  13.  
  14. # Default server configuration
  15. #
  16. server {
  17. listen 127.0.0.1:8080 default_server;
  18.  
  19. # SSL configuration
  20. #
  21. # listen 443 ssl default_server;
  22. # listen [::]:443 ssl default_server;
  23. #
  24. # Note: You should disable gzip for SSL traffic.
  25. # See: https://bugs.debian.org/773332
  26. #
  27. # Read up on ssl_ciphers to ensure a secure configuration.
  28. # See: https://bugs.debian.org/765782
  29. #
  30. # Self signed certs generated by the ssl-cert package
  31. # Don't use them in a production server!
  32. #
  33. # include snippets/snakeoil.conf;
  34.  
  35. root /var/www/html;
  36.  
  37. error_page 404 /errors/404.html;
  38. location = /404.html {
  39. root /var/www/html;
  40. internal;
  41. }
  42. error_page 403 /errors/403.html;
  43. location = /403.html {
  44. root /var/www/html;
  45. internal;
  46. }
  47. # Add index.php to the list if you are using PHP
  48. index index.html index.php index.htm index.nginx-debian.html;
  49.  
  50. server_name localhost;
  51. server_tokens off;
  52. location / {
  53. # First attempt to serve request as file, then
  54. # as directory, then fall back to displaying a 404.
  55. try_files $uri $uri/ =404;
  56. }
  57.  
  58. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  59. #
  60. location ~ \.php$ {
  61. include snippets/fastcgi-php.conf;
  62.  
  63. # With php7.0-cgi alone:
  64. # fastcgi_pass 127.0.0.1:9000;
  65. # With php7.0-fpm:
  66. fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  67. }
  68.  
  69. # deny access to .htaccess files, if Apache's document root
  70. # concurs with nginx's one
  71. #
  72. location ~ / {
  73. allow 127.0.0.1;
  74. deny all;
  75. }
  76. location ~ /\.ht {
  77. deny all;
  78. }
  79. }
  80. # Virtual Host configuration for example.com
  81. #
  82. # You can move that to a different file under sites-available/ and symlink that
  83. # to sites-enabled/ to enable it.
  84. #
  85. #server {
  86. # listen 80;
  87. # listen [::]:80;
  88. #
  89. # server_name example.com;
  90. #
  91. # root /var/www/example.com;
  92. # index index.html;
  93. #
  94. # location / {
  95. # try_files $uri $uri/ =404;
  96. # }
  97. #}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement