1.首先在nginx的html目录下创两个文件夹分别用于放两个前端打包好的静态资源,而且把静态资源各自放好:
2. 在nginx的配置文件里,写好两个server。如图,写好两个前端要用的端口以及刚才那两文件夹的路径:
- worker_processes 1;
- events {
- worker_connections 1024;
- }
- http {
- include mime.types;
- default_type application/octet-stream;
- server {
- listen 8081;
- server_name localhost;
- location / {
- root html/manage;
- index index.html index.htm;
- }
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- }
- server {
- listen 8082;
- server_name localhost;
- location / {
- root html/client;
- index index.html index.htm;
- }
- error_page 500 502 503 504 /50x.html;
- location = /50x.html {
- root html;
- }
- }
- }
复制代码 3. 再双击一下nginx.exe就可以了:
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。 |