upstream backend {
server 192.168.10.137:9501 weight=1;
server 192.168.10.137:9502 weight=1;
}
server {
listen 80;
server_name kitchen.site.cmstop.lsw ;
root “C:\cmstop\backend\public\admin”;
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
location = /favicon.ico {
log_not_found off;
access_log off;
}
location ^~ /im_tool/ {
alias /data/www/Cloud/im/dist/;
}
location ~ .*/\.(ht2|ht|htaccess|ini|cvf|svn|git|txt|conf|sh|py|pl|rb|cgi)$ {
deny all;
}
location = /index.php {
# Ensure that there is no such file named "not_exists"
# in your "public" directory.
try_files /not_exists @swoole;
}
location / {
try_files $uri $uri/ @swoole;
}
location @swoole {
set $suffix "";
if ($uri = /index.php) {
set $suffix "/";
}
proxy_set_header Host $host;
proxy_set_header SERVER_PORT $server_port;
proxy_set_header REMOTE_ADDR $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
# IF https
# proxy_set_header HTTPS "on";
proxy_pass http://backend$suffix;
}
}