2017/03/19 22:38:27 [error] 5100#5100: *5 open() "/var/www/mysite.ru/user" failed (2: No such file or directory), client: 11.111.111.111, server: mysite.ru, request: "GET /user HTTP/1.1", host: "mysite.ru"
server {
listen 80;
listen [::]:80;
root /var/www/mysite.ru;
server_name mysite.ru www.mysite.ru;
location / {
try_files $uri /index.php?$query_string;
}
#location @rewrite {
# rewrite ^/(.*)$ /index.php?q=$1;
# }
location ~ \.php$ {
include snippets/fastcgi-php.conf;
fastcgi_pass unix:/run/php/php7.0-fpm.sock;
}
location ~ (^|/)\. {
return 403;
}
location ~ ^/sites/.*/private/ {
return 403;
}
location ~* ^/.well-known/ {
allow all;
}
location ~* \.(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$ {
add_header Access-Control-Allow-Origin *;
}
location ~* ^.+\.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|css|js)$ {
access_log off;
log_not_found off;
try_files $uri $uri/ /index.html;
expires max;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
location ~* \.(txt|log)$ {
include /etc/nginx/conf.d/wpip-block.conf; #здесь allow и deny
include /etc/nginx/conf.d/php.conf; #тут php
}
location /admin {
include /etc/nginx/conf.d/wpip-block.conf;
include /etc/nginx/conf.d/php.conf;
}
location /user {
include /etc/nginx/conf.d/wpip-block.conf;
include /etc/nginx/conf.d/php.conf;
}
location ~ \..*/.*\.php$ {
return 403;
}
location ~ /vendor/.*\.php$ {
deny all;
return 404;
}
}
user www-data;
worker_processes auto;
pid /run/nginx.pid;
events {
worker_connections 1024;
multi_accept on;
}
http {
#limit_conn_zone $binary_remote_addr zone=slimits:5m;
#limit_conn slimits 100;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 30;
keepalive_requests 100;
send_timeout 2;
types_hash_max_size 2048;
server_tokens off;
reset_timedout_connection on;
client_header_buffer_size 1k;
client_header_timeout 10;
client_body_buffer_size 10K;
client_body_timeout 10;
client_max_body_size 8m;
large_client_header_buffers 2 2k;
index index.php index.html index.htm;
server_names_hash_bucket_size 64;
# server_name_in_redirect off;
include /etc/nginx/mime.types;
default_type application/octet-stream;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2; # Dropping SSLv3, ref: POODLE
ssl_prefer_server_ciphers on;
access_log /var/log/nginx/access.log;
error_log /var/log/nginx/error.log;
gzip on;
gzip_disable "msie6";
gzip_static on;
gzip_vary on;
gzip_proxied any;
gzip_comp_level 5;
# gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
open_file_cache max=200000 inactive=20s;
open_file_cache_valid 30s;
open_file_cache_min_uses 2;
open_file_cache_errors on;
#include /etc/nginx/conf.d/*.conf;
include /etc/nginx/sites-enabled/*;
}
iptables -A INPUT -p tcp -s 11.11.111.11 -m multiport --dports 80 string --string 'POST /wp-login.php' -j ACCEPT
iptables -A INPUT -p tcp -m multiport --dports 80 string --string 'POST /wp-login.php' -j DROP
Можете сразу в DNS задать 2 разных IP. Современные браузеры будут использовать тот адрес, что отвечает. Разумеется, это не будет работать, если связь прервется во время сеанса пользователя.
некоторое время 2 сервера обслуживают один и тот же сайт параллельно.Чем это проще и для чего? Как это к теме относится? Я представил обычный переезд на другой сервер.
пока не протухнет DNS