Advertisement
TheVer4

nginx.cnf

Dec 30th, 2019
2,462
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #user html;
  2.  
  3. worker_processes  2;
  4.  
  5. #error_log  logs/error.log;
  6. #error_log  logs/error.log  notice;
  7. #error_log  logs/error.log  info;
  8. #pid        logs/nginx.pid;
  9.  
  10. events {
  11.     worker_connections  1024;
  12. }
  13.  
  14. http {
  15.     include       mime.types;
  16.     default_type  application/octet-stream;
  17.     sendfile        on;
  18.  
  19.     #tcp_nopush     on;
  20.     #keepalive_timeout  0;
  21.  
  22.     keepalive_timeout  65;
  23.  
  24.     gzip  on;
  25.  
  26.     types_hash_max_size 4096;
  27.  
  28.     server {
  29.         listen       80;
  30.         server_name  localhost;
  31.         root   /usr/share/nginx/html;
  32.         charset utf-8;
  33.         location / {
  34.             index  index.php index.html index.htm;
  35.             autoindex on;
  36.             autoindex_exact_size off;
  37.             autoindex_localtime on;
  38.         }
  39.  
  40.         location /phpmyadmin {
  41.             rewrite ^/* /phpMyAdmin last;
  42.         }
  43.  
  44.         error_page  404              /404.html;
  45.         # redirect server error pages to the static page /50x.html
  46.         error_page   500 502 503 504  /50x.html;
  47.  
  48.         location = /50x.html {
  49.             root   /usr/share/nginx/html;
  50.         }
  51.  
  52.         location ~ \.php$ {
  53.             #fastcgi_pass 127.0.0.1:9000; (зависит от конфигурации сокета вашего php-fpm)
  54.             fastcgi_pass unix:/run/php-fpm/php-fpm.sock;
  55.             fastcgi_index index.php;
  56.             include fastcgi.conf;
  57.         }
  58.  
  59.         location ~ /\.ht {
  60.             deny  all;
  61.         }
  62.     }        
  63. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement