#### NGINX配置记录
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 | 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; }<br> 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; }<br> location ^~ /cmsApi/ { proxy_pass https: //cms .itangka.com; } } |
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 10年+ .NET Coder 心语 ── 封装的思维:从隐藏、稳定开始理解其本质意义
· 地球OL攻略 —— 某应届生求职总结
· 提示词工程——AI应用必不可少的技术
· Open-Sora 2.0 重磅开源!
· 周边上新:园子的第一款马克杯温暖上架