Separation of front and back --- all pages are written in the front-end ( published and forwarded with nginx in the front-end ), and only the interface is prepared in the background
niginx has the linux version of the page and the windows version of the configuration direction proxy method is the same
When proxying, the ip address part is equivalently replaced, and the project name (the context is placed behind it as it is)
Generally, the wondows version is used for local testing (click .exe to see if there is any service, there will be no configuration errors)
server {
listen 8126;
server_name localhost;
location / {
root C:/Users/yy/Desktop/distph;
try_files $uri $uri/ /index.html;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
location /hb_phonebank_web {
client_max_body_size 10M;
proxy_pass http://127.0.0.1:8080;
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Real-IP $remote_addr;
}
}