- server
- {
- listen 7000;
- listen 6661;
- listen 666;
- listen 6663;
- server_name 1.1.1.com;
- index index.html;
- set $projectPath 'im';
- if ($http_cookie ~* 'IM_From_Mobile') {
- set $projectPath 'h5';
- }
- root /www/wwwroot/web/deploy/$projectPath;
- access_log /www/wwwroot/web/logs/im-access.log;
- error_log /www/wwwroot/web/logs/im-error.log;
- client_max_body_size 50M;
-
- #ERROR-PAGE-START 错误页配置,可以注释、删除或修改
- error_page 404 /404.html;
- error_page 502 /502.html;
-
- #PHP-INFO-START PHP引用配置,可以注释或修改
- #include enable-php-00.conf;
- include /www/server/panel/vhost/rewrite/1.1.1.com.conf;
- #REWRITE-END
- #禁止访问的文件或目录
- location ~ ^/(\.user.ini|\.htaccess|\.git|\.svn|\.project|LICENSE|README.md)
- {
- return 404;
- }
- #一键申请SSL证书验证目录相关设置
- location ~ \.well-known{
- allow all;
- }
- location ~ ^/plate.*\.(gif|jpg|jpeg|png|bmp|swf)$
- {
- expires 30d;
- #error_log off;
- #access_log /dev/null;
- root /data;
- }
- location / {
- try_files $uri $uri/ /index.html?$query_string;
- root /www/wwwroot/web/deploy/$projectPath;
- }
- location ~ ^/plate {
- root /data;
- }
- location /api {
- rewrite ^/api/(.*)$ /api/$1 break;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_pass http://127.0.0.1:1990/;
- }
- location /manage {
- rewrite ^/manage/(.*)$ /manage/$1 break;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header Host $host;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- proxy_set_header X-Forwarded-Proto $scheme;
- proxy_pass http://127.0.0.1:1990/;
- }
- }
复制代码 |