81,092
社区成员
发帖
与我相关
我的任务
分享
http {
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
#tcp_nopush on;
keepalive_timeout 65;
#gzip on;
server {
listen 8081;
server_name localhost;
root /var/local/central/central_web/;
index index.html;
location /api {
proxy_pass http://localhost:8760;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
}
}
}
server {
listen 8081;
server_name localhost;
root /var/local/central/central_web/;
index index.html;
#前端路径代理
location /exam {
root html;
index index.html index.htm;
}
#后台路径代理
location /api/ {
proxy_pass http://localhost:8760;
add_header 'Access-Control-Allow-Origin' '*';
add_header 'Access-Control-Allow-Credentials' 'true';
}
}