12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- server {
- listen 80;
- server_name localhost;
- #charset koi8-r;
- access_log /var/log/nginx/host.access.log main;
- error_log /var/log/nginx/error.log error;
- location / {
- root /usr/share/nginx/html;
- index index.html index.htm;
- try_files $uri $uri/ /index.html;
- }
-
- location /admin-api/ { ## 后端项目 - 管理后台
- proxy_pass http://42.194.163.46:48080/admin-api/; ## 重要!!!proxy_pass 需要设置为后端项目所在服务器的 IP
- proxy_set_header Host $http_host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header REMOTE-HOST $remote_addr;
- proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
- }
- location /app-api/ { ## 后端项目 - 用户 App
- proxy_pass http://42.194.163.46:48080/app-api/; ## 重要!!!proxy_pass 需要设置为后端项目所在服务器的 IP
- proxy_set_header Host $http_host;
- proxy_set_header X-Real-IP $remote_addr;
- proxy_set_header REMOTE-HOST $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;
- }
- }
|