Advertisement
Guest User

Untitled

a guest
Jun 7th, 2017
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.36 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 80;
  18. listen [::]:80;
  19.  
  20. # SSL configuration
  21. #
  22. # listen 443 ssl default_server;
  23. # listen [::]:443 ssl default_server;
  24. #
  25. # Note: You should disable gzip for SSL traffic.
  26. # See: https://bugs.debian.org/773332
  27. #
  28. # Read up on ssl_ciphers to ensure a secure configuration.
  29. # See: https://bugs.debian.org/765782
  30. #
  31. # Self signed certs generated by the ssl-cert package
  32. # Don't use them in a production server!
  33. #
  34. # include snippets/snakeoil.conf;
  35.  
  36. #root /var/www/html/$domain/public/; данный вариант не сработал
  37.  
  38. # Add index.php to the list if you are using PHP
  39. index index.php index.html index.htm index.nginx-debian.html;
  40.  
  41. server_name ~^(www\.)?(?<domain>.+)$;
  42.  
  43. access_log /var/www/html/$domain/log/access.log
  44. error_log /var/www/html/$domain/log/error.log
  45.  
  46. location / {
  47. root /var/www/html/$domain/public/; # пробовал и так, не работает
  48. # First attempt to serve request as file, then
  49. # as directory, then fall back to displaying a 404.
  50. try_files $uri $uri/ =404;
  51. }
  52.  
  53. # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
  54. #
  55. location ~ \.php$ {
  56. include snippets/fastcgi-php.conf;
  57. #
  58. # # With php7.0-cgi alone:
  59. # fastcgi_pass 127.0.0.1:9000;
  60. # # With php7.0-fpm:
  61. fastcgi_pass unix:/run/php/php7.0-fpm.sock;
  62. }
  63.  
  64. # deny access to .htaccess files, if Apache's document root
  65. # concurs with nginx's one
  66. #
  67. location ~ /\.ht {
  68. deny all;
  69. }
  70. }
  71.  
  72.  
  73. # Virtual Host configuration for example.com
  74. #
  75. # You can move that to a different file under sites-available/ and symlink that
  76. # to sites-enabled/ to enable it.
  77. #
  78. #server {
  79. # listen 80;
  80. # listen [::]:80;
  81. #
  82. # server_name example.com;
  83. #
  84. # root /var/www/example.com;
  85. # index index.html;
  86. #
  87. # location / {
  88. # try_files $uri $uri/ =404;
  89. # }
  90. #}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement