nginx配置前后端分离服务
1 user nginx; 2 3 worker_processes auto; 4 5 #error_log logs/error.log; 6 7 #error_log logs/error.log notice; 8 9 error_log logs/error.log info; 10 11 12 13 pid logs/nginx.pid; 14 15 events { 16 17 worker_connections 1024; 18 19 } 20 21 http { 22 23 include mime.types; 24 25 default_type application/octet-stream; 26 27 28 29 log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 30 31 '$status $body_bytes_sent "$http_referer" ' 32 33 '"$http_user_agent" "$http_x_forwarded_for"'; 34 35 36 37 access_log logs/access.log main; 38 39 40 41 sendfile on; 42 43 tcp_nopush on; 44 45 46 47 keepalive_timeout 65; 48 49 server { 50 51 listen 80; 52 53 server_name localhost; 54 55 #前端dist路径 56 57 root /usr/local/nginx/html/dist-army; 58 59 index index.html index.htm; 60 61 #后端接口地址 62 63 location ^~ /v1/ { 64 65 index index; 66 67 proxy_pass http://XXXXXXX:9090; 68 69 } 70 71 } 72 73 }
多情自古空余恨
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· 单线程的Redis速度为什么快?