nodejs项目,vue开发环境,可以配置,域名访问模式嘛,这样线上项目就可以不用打包来访问了

看了很多博文,本地也配置了,域名需要结合端口号来访问(多个项目也不可能都是80 的,所以还是需要端口号的)
不需要nginx配置

/etc/host 域名指向127.0.0.1

--------------------不需要端口号,需从nginx配置入手,参考下列博文-------------------------------------

  • nginx 需配置支持 proxy_path,需安装 ngx_http_proxy_module 模块

  • mac 怎么安装 ngx_http_proxy_module 模块 ??????

  • zb-mac nginx包配置初始情况

zb@zbdeMacBook-Pro 1.19.6 % nginx -V
nginx version: nginx/1.19.6
built by clang 12.0.0 (clang-1200.0.32.28)
built with OpenSSL 1.1.1i  8 Dec 2020
TLS SNI support enabled

configure arguments: --prefix=/opt/homebrew/Cellar/nginx/1.19.6 --sbin-path=/opt/homebrew/Cellar/nginx/1.19.6/bin/nginx --with-cc-opt='-I/opt/homebrew/opt/pcre/include -I/opt/homebrew/opt/openssl@1.1/include' --with-ld-opt='-L/opt/homebrew/opt/pcre/lib -L/opt/homebrew/opt/openssl@1.1/lib' --conf-path=/opt/homebrew/etc/nginx/nginx.conf --pid-path=/opt/homebrew/var/run/nginx.pid --lock-path=/opt/homebrew/var/run/nginx.lock --http-client-body-temp-path=/opt/homebrew/var/run/nginx/client_body_temp --http-proxy-temp-path=/opt/homebrew/var/run/nginx/proxy_temp --http-fastcgi-temp-path=/opt/homebrew/var/run/nginx/fastcgi_temp --http-uwsgi-temp-path=/opt/homebrew/var/run/nginx/uwsgi_temp --http-scgi-temp-path=/opt/homebrew/var/run/nginx/scgi_temp --http-log-path=/opt/homebrew/var/log/nginx/access.log --error-log-path=/opt/homebrew/var/log/nginx/error.log --with-compat --with-debug --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_degradation_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-ipv6 --with-mail --with-mail_ssl_module --with-pcre --with-pcre-jit --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module

posted @ 2022-10-31 10:13  盘思动  阅读(191)  评论(0编辑  收藏  举报