35 lines
1.1 KiB
Plaintext
35 lines
1.1 KiB
Plaintext
|
|
upstream prod_java_search {
|
||
|
|
server 10.0.0.10:8070;
|
||
|
|
server 10.0.0.8:8070;
|
||
|
|
}
|
||
|
|
server{
|
||
|
|
listen 50301;
|
||
|
|
server_name _;
|
||
|
|
|
||
|
|
access_log /data/tengine/logs/java_prod_agent_ip_access.log;
|
||
|
|
error_log /data/tengine/logs/java_prod_agent_ip_error.log;
|
||
|
|
|
||
|
|
|
||
|
|
location / {
|
||
|
|
proxy_pass http://prod_java_search;
|
||
|
|
proxy_set_header Host $host;
|
||
|
|
proxy_set_header X-Real-IP $remote_addr;
|
||
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
||
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
||
|
|
|
||
|
|
proxy_buffering off;
|
||
|
|
proxy_cache off;
|
||
|
|
proxy_http_version 1.1;
|
||
|
|
proxy_set_header Connection "";
|
||
|
|
|
||
|
|
add_header 'Access-Control-Allow-Origin' "$http_origin" always;
|
||
|
|
add_header 'Access-Control-Allow-Credentials' 'true' always;
|
||
|
|
add_header 'Access-Control-Allow-Methods' 'GET, POST, OPTIONS, PUT, DELETE' always;
|
||
|
|
add_header 'Access-Control-Allow-Headers' 'Authorization,Content-Type,X-Requested-With,Accept,Origin' always;
|
||
|
|
|
||
|
|
if ($request_method = OPTIONS ) {
|
||
|
|
return 204;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|