Nginx部署多个Web应用和静态网页

容器中的nginx暴露一个端口部署多个功能的网站_witton的博客-CSDN博客

windows下使用 nginx部署静态页面(两个静态项目文件)_nginx配置多页面_新征程,再出发的博客-CSDN博客

Windows系统如何在本地(localhost)配置Nginx支持多个网站?_localhost配置文件-CSDN博客

最终的整个nginx.conf配置文件内容如下

#user  nobody;
worker_processes  auto;
events {
    worker_connections  1024;
    multi_accept on;
}
http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        off;
    tcp_nopush     on;
    client_max_body_size 200m;
    #默认支持的站点
    server {
        listen       80 default_server;
        server_name  localhost;
        root   html;
        location / {
            #include wordpress.conf; #这里加载支持wordpress网站修改固定链接的配置
            index  index.php index.html index.htm;
        }
        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
           root   html;
        }
 
        # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
        #   
        location ~ \.php$ {
            root           html;
            fastcgi_pass   127.0.0.1:9000;
            fastcgi_index  index.php;
            fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
            include        fastcgi_params;
        }
    }
    #新添加的模拟域名站点1:siliconcircuit.asia
    server {
        listen    81;
        server_name  siliconcircuit.asia;
     
        root  D:/WNMP/Nginx/html/mulitiWordPress/siliconcircuit.asia/;
        index   index.php index.html index.htm;
     
        location / {
          allow  all;
        }
    }
    #新添加的模拟域名站点2:jianwangzhan.online
    server {
        listen    82;
        server_name  jianwangzhan.online;
     
        root  D:/WNMP/Nginx/html/mulitiWordPress/jianwangzhan.online/;
        index   index.php index.html index.htm;
     
        location / {
          allow  all;
        }
    }
}

nginx 部署多个项目 的两种方式_nginx部署多个web项目__Rookie._的博客-CSDN博客

https://www.cnblogs.com/btxlc/p/11592886.html  nginx配置部署多个单页应用 踩坑

  • 7
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值