1 Star 0 Fork 125

dsgk/neatlogic-itom-all

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
nginx.conf 2.84 KB
一键复制 编辑 原始数据 按行查看 历史
lvzk 提交于 2024-05-22 03:17 . update nginx.conf.
user root;
worker_processes 1;
pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
client_max_body_size 1024m;
log_format main '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" "$http_x_forwarded_for"';
log_format postdata $request_body;
access_log /app/logs/nginx/access.log postdata;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
#gzip on;
server {
listen 8090;
server_name localhost;
charset utf-8;
set $appaddr 127.0.0.1:8080;
set $webroot /app/neatlogic-web/dist;
#access_log /app/logs/nginx/host.access.log main;
#client_body_temp_path /var/log/nginx/client_request;
client_body_in_file_only clean;
location ~ /anonymous/api/(.*) {
proxy_pass http://127.0.0.1:8080/neatlogic/anonymous/api/$1?$args;
proxy_set_header X-Forwarded-For $remote_addr;
}
location ~ /([^\/]+)/public/api/(.*) {
set $modified_uri $request_uri;
if ($modified_uri ~ "^/([^\/]+)/public/api/([^\?]+)") {}
proxy_pass http://127.0.0.1:8080/neatlogic/public/api/$2?$args;
proxy_set_header Tenant $1;
proxy_set_header Cookie $http_cookie;
proxy_set_header X-Forwarded-For $remote_addr;
}
location ~ /([^\/]+)/api/(.*) {
proxy_pass http://$appaddr/neatlogic/api/$2?$args;
proxy_set_header Tenant $1;
proxy_set_header Cookie $http_cookie;
proxy_set_header X-Forwarded-For $remote_addr;
}
location ~ /([^\/]+)/([^\/]+)/check$ {
proxy_pass http://$appaddr/neatlogic/$2/check/$1?$args;
proxy_set_header Tenant $1;
}
location ~ ^.*/resource/(.*)$ {
alias $webroot/resource/$1;
break;
}
location ~ .*/login.html {
root $webroot;
rewrite .* /login.html break;
}
location ~ /([^\/]*).html {
add_header Cache-Control 'private, no-store, max-age=0';
add_header Access-Control-Allow-Origin *;
alias $webroot;
try_files /$1.html break;
}
#match default route
location = / {
#设置默认租户导航,当访问根路径时重定向到默认租户
rewrite ^.*$ /demo/ permanent;
}
location / {
alias $webroot;
try_files /index.html break;
}
error_page 404 404.html;
location ~ /404.html$ {
alias $webroot/;
}
error_page 500 502 503 504 50x.html;
location ~ /50x.html$ {
#root html;
alias html/;
}
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/dsgk/neatlogic-itom-all.git
git@gitee.com:dsgk/neatlogic-itom-all.git
dsgk
neatlogic-itom-all
neatlogic-itom-all
develop3.0.0

搜索帮助