62 lines
1.6 KiB
Nginx Configuration File
62 lines
1.6 KiB
Nginx Configuration File
upstream payment_backend {
|
|
server $APP_API_URL;
|
|
}
|
|
|
|
server {
|
|
listen 80;
|
|
listen [::]:80;
|
|
server_name localhost;
|
|
|
|
#access_log /var/log/nginx/host.access.log main;
|
|
gzip on; # 是否开启gzip
|
|
gzip_buffers 32 4K;
|
|
gzip_comp_level 5;
|
|
gzip_min_length 10k;
|
|
gzip_types application/javascript text/css text/xml;
|
|
gzip_disable "MSIE [1-6]\.";
|
|
gzip_http_version 1.1;
|
|
gzip_vary on;
|
|
|
|
location / {
|
|
root /app;
|
|
if (!-e $request_filename) {
|
|
rewrite ^(.*)$ /index.html last;
|
|
break;
|
|
}
|
|
}
|
|
|
|
location ^~/api {
|
|
proxy_pass http://payment_backend;
|
|
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 REMOTE-HOST $remote_addr;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_http_version 1.1;
|
|
proxy_ssl_verify off;
|
|
# proxy_hide_header Upgrade;
|
|
|
|
add_header X-Cache $upstream_cache_status;
|
|
}
|
|
|
|
|
|
#PROXY-START/staff-api/
|
|
location ^~ /staff-api
|
|
{
|
|
proxy_pass https://103.124.155.66/api;
|
|
proxy_set_header Host test-api.hkchc.team;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header REMOTE-HOST $remote_addr;
|
|
proxy_set_header Upgrade $http_upgrade;
|
|
proxy_set_header Connection $connection_upgrade;
|
|
proxy_http_version 1.1;
|
|
# proxy_hide_header Upgrade;
|
|
|
|
add_header X-Cache $upstream_cache_status;
|
|
}
|
|
#PROXY-END/
|
|
|
|
}
|
|
|