Nginx 如何建立多个web服务 使用不同端口
server {
listen 8080;
server_name ip;
#charset koi8-r;
#access_log logs/host.access.log main;article/list/0/json
location / {
if ($request_method = 'OPTIONS') {
return 204;
}
root html/Web1;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
这假如是原本的 只需要再次建立一个 server模块 修改端口即可
server {
listen 8081;
server_name ip;
#access_log logs/host.access.log main;article/list/0/json
location / {
if ($request_method = 'OPTIONS') {
return 204;
}
root html/Web2;
index index.html index.htm;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
完事重启
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】凌霞软件回馈社区,博客园 & 1Panel & Halo 联合会员上线
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】博客园社区专享云产品让利特惠,阿里云新客6.5折上折
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 一个费力不讨好的项目,让我损失了近一半的绩效!
· 实操Deepseek接入个人知识库
· CSnakes vs Python.NET:高效嵌入与灵活互通的跨语言方案对比
· 【.NET】调用本地 Deepseek 模型
· Plotly.NET 一个为 .NET 打造的强大开源交互式图表库
2019-10-10 Flutter 工程报错 Failed to create provisioning profile.
2019-10-10 Flutter 布局类组件