前端端口 8081 后端端口 8083 我现在设置了nginx 代理 请求不到后端能不能帮我看看
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
#pid logs/nginx.pid;
events {
worker_connections 1024;
}
http {
include mime.types;
default_type application/octet-stream;
sendfile on;
#tcp_nopush on;
#keepalive_timeout 0;
keepalive_timeout 65;
#gzip on;
server {
listen 8088;
server_name localhost;
location / {
root html/dist;
index index.html index.htm index.php;
proxy_pass http://127.0.0.1:8081;
}
location /api {
proxy_pass http://127.0.0.1:8083;
proxy_set_header Host $http_host;
}
}
}
你这里是监听8088,然后转发给8081,和api转给8083,貌似并不是前端用8081启动