server { listen 80; listen [::]:80; server_name localhost; resolver 8.8.8.8; #access_log /var/log/nginx/host.access.log main; location / { root /usr/share/nginx/html; index index.html index.htm; } set $stg_token "C1qziFGlIv3tnCQxcFaStrLuZOO2ZZXjN7FB_G0WlrOLjclfObbSaXAKzl4RWwQBf_0Zhsm0CoVvdVsYMD18iM_LJrxtn7LHJJQuF9UoUuF3fvqOwrG4EF6Z4GahtxtQ2oeaPQBBNKlgVW1xUW7tkhEdXWqzDHPA_I_91Lczk0PI4guhx1c88Hst4-HI8pdMbiUdEJzj3d3a2W06Fa0XA9Q0taAwaRd1k9jUrDVyj9GfS84_SIgJF4SPjWVfsraV79ieb_StgRcUwZjbscGPMlifnJD6F00wwNbxG7AuCHbl3EtMfSed1vuVx3AsizIckwzIVSVRpOGw72cdAMui-I6es9Ozj2ITzSa5KgyXEpX4qCHF1VcCM1wlHLQ_5hLnJIi4r8NsnJPsxMYrTw"; set $prd_token "NzgW_pgTU_aiLoih3Zs0D8y87RmzWhvyv9vM46BjWpR-KnNRbPXw128afKHLS_wqUcvUPaILQ8bADxCyiuuiHYSn25IyZkKfAw-ZkVmcTMgDy8XY7fBlmhkHqzWYm7T9wBVeCjZ-KlSoRSOOuSvIbVAGKn-JktiE2hbNc9X5oHe0LOK3Zvy2TnwvATRfxjsVwduBOIQRcJ7fxbhxp-VOoaOQ6v1S3orhSb1b-MfasJbGizVDujMvgP3vAYCYu6ctweY3WUU_7cbCKNFA00D1KYlvsjZsWPqyAERy1-C7MgpWUm_yNZFPwh_ChebF2Vv5Oq_P3LefSAAKkZxuvCwo7dTby6ris-c1BiTYutR5kbXKlqkKiT_FsiYQ7ygO2_drKi0HrXBtm9qg"; location /openapi-stg/ { rewrite ^/openapi-stg/(.*)$ /$1 break; proxy_pass https://fls-ai-stg-sit.pingan.com.cn/openapi$uri?token=$stg_token&channelId=ASP-TEST&sceneId=ASP-TEST&$args; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } location /openapi-prd/ { rewrite ^/openapi-prd/(.*)$ /$1 break; proxy_pass https://fls-ai.pingan.com.cn/openapi$uri?token=$prd_token&channelId=ASP-TEST&sceneId=ASP-TEST&$args; proxy_set_header Host $host; proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; } #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root /usr/share/nginx/html; } # proxy the PHP scripts to Apache listening on 127.0.0.1:80 # #location ~ \.php$ { # proxy_pass http://127.0.0.1; #} # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000 # #location ~ \.php$ { # root html; # fastcgi_pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi_param SCRIPT_FILENAME /scripts$fastcgi_script_name; # include fastcgi_params; #} # deny access to .htaccess files, if Apache's document root # concurs with nginx's one # #location ~ /\.ht { # deny all; #} }