#### NGINX配置记录
server {
listen 80;
server_name www.222.com;
charset utf-8;
#root html/222/wap/dist;
# location /robots.txt {
# 301 重定向
#return 301 http://www.333.com;
if ($time_iso8601 ~ "(\d{4})-(\d{2})-(\d{2})") {
# set $day $1$2$3;
set $day $1$2;
}
access_log /usr/local/222/nginx/logs/client_access_$day.log combined;
location /ch {
try_files $uri $uri/ /ch/index.html;
}
location / {
add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
proxy_set_header Host $http_host;
proxy_pass http://localhost:8969;
}
location /mobile {
proxy_set_header x-real-ip $remote_addr;
add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
proxy_pass http://localhost:8999;
}
location ^~ /cmsApi/ {
proxy_pass https://cms.111.com;
}
}
server {
listen 443;
server_name www.22.com;
# 301 重定向
#return 301 https://www.3333.com;
if ($time_iso8601 ~ "(\d{4})-(\d{2})-(\d{2})") {
set $day $1$2;
}
access_log /usr/local/222/nginx/logs/client_access_$day.log combined;
ssl on;
ssl_stapling on;
ssl_stapling_verify on;
resolver 8.8.4.4 8.8.8.8;
ssl_certificate cert/22/22.com.crt;
ssl_certificate_key cert/22/22.com.key;
ssl_session_cache shared:SSL:1m;
ssl_session_timeout 5m;
ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4;
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
root html/22/wap/dist;
location /robots.txt {
return 200 "User-agent: JikeSpider\nDisallow: /\n\nUser-agent: YYSpider\nDisallow: /\n\nUser-agent: *\nDisallow: /*?*\nDisallow: /user\nDisallow: /login\nDisallow: /cmsApi\nDisallow: /_nuxt\nDisallow: /card*\nDisallow: /goods/detail/undefined*\nDisallow: /landing\n\nSitemap: https://www.kongfuka.com/sitemap.txt";
}
#location /h5newsmap2.txt {
# alias html/222/wap/dist/222.txt;
#}
location ^~ /priceSpider/ {
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
rewrite ^/priceSpider/(.*)$ /$1 break;
proxy_pass http://localhost:3121;
}
location /ch {
try_files $uri $uri/ /ch/index.html;
}
location / {
add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
proxy_set_header Host $http_host;
proxy_pass http://localhost:8969;
}
location /mobile {
proxy_set_header x-real-ip $remote_addr;
add_header Access-Control-Allow-Origin '*';
add_header Access-Control-Allow-Methods 'GET, POST, OPTIONS';
add_header Access-Control-Allow-Headers 'DNT,X-Mx-ReqToken,Keep-Alive,User-Agent,X-Requested-With,If-Modified-Since,Cache-Control,Content-Type,Authorization';
proxy_pass http://localhost:8999;
}
location /activitys {
try_files $uri $uri/ /activitys/index.html;
#try_files $uri $uri/ /index.html;
}
location ^~ /cmsApi/ {
proxy_pass https://cms.itangka.com;
}
}
浙公网安备 33010602011771号