Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- user www-data;
- worker_processes auto;
- pid /run/nginx.pid;
- events {
- worker_connections 768;
- }
- http {
- sendfile on;
- #tcp_nopush on;
- #tcp_nodelay on;
- keepalive_timeout 65;
- types_hash_max_size 2048;
- include /etc/nginx/mime.types;
- default_type application/octet-stream;
- ##
- # Upstream PHP
- ##
- upstream php {
- server unix:/tmp/php-fpm.sock;
- server 127.0.0.1:9000;
- }
- ##
- # SSL Settings
- ##
- ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
- ssl_prefer_server_ciphers on;
- ##
- # Logging Settings
- ##
- access_log /var/log/nginx/access.log;
- error_log /var/log/nginx/error.log debug;
- include /etc/nginx/conf.d/*.conf;
- include /etc/nginx/sites-enabled/*;
- }
- server {
- listen 80;
- listen [::]:80;
- index index.php;
- location = /favicon.ico {
- log_not_found off;
- access_log off;
- }
- location = /robots.txt {
- allow all;
- log_not_found off;
- access_log off;
- }
- location / {
- # This is cool because no php is touched for static content.
- # include the "?$args" part so non-default permalinks doesn't break when using query string
- try_files $uri $uri/ /index.php?$args;
- }
- location ~ .php$ {
- #NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
- include fastcgi.conf;
- fastcgi_intercept_errors on;
- fastcgi_pass php;
- fastcgi_buffers 16 16k;
- fastcgi_buffer_size 32k;
- }
- location ~* .(js|css|png|jpg|jpeg|gif|ico)$ {
- expires max;
- # log_not_found off;
- }
- }
- location = /favicon.ico {
- log_not_found off;
- access_log off;
- }
- # robots.txt fallback to index.php
- location = /robots.txt {
- # Some WordPress plugin gererate robots.txt file
- allow all;
- try_files $uri $uri/ /index.php?$args @robots;
- access_log off;
- log_not_found off;
- }
- location @robots {
- return 200 "User-agent: *nDisallow: /wp-admin/nAllow: /wp-admin/admin-ajax.phpn";
- }
- location ~ /.(?!well-known/) {
- deny all;
- }
- location /wp-content/uploads {
- location ~ .php$ {
- deny all;
- }
- }
- location ~* /(?:uploads|files)/.*.php$ {
- deny all;
- }
- server {
- root /var/www/html;
- index index.html index.htm index.nginx-debian.html index.php;
- server_name mydomain.site www.mydomain.site;
- location / {
- try_files $uri $uri/ =404;
- }
- location ~ .php$ {
- include snippets/fastcgi-php.conf;
- fastcgi_pass unix:/run/php/php7.0-fpm.sock;
- }
- }
- server {
- include global/wordpress.conf;
- include global/wp-restrictions.conf;
- server_name sub.mydomain.site;
- root /var/www/microsites/lgw/;
- index index.php;
- }
Add Comment
Please, Sign In to add comment