lunix nginx vue项目发布
nginx.conf自动生成软件:
nginxWebUI
https://gitee.com/cym1102/nginxWebUI?_from=gitee_search
nginx.conf
#user nobody; worker_processes 8; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; upstream http_BIMG { server 127.0.0.1:6551; keepalive 16; } include inc/pbd.conf; include inc/face.conf; #include inc/cyqz.conf; #include inc/rz.conf; }
face.conf
server { listen 8066; server_name ip; location / #设定访问静态文件直接读取不经过tomcat { root /usr/local/nginx/dist/; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } }
多端口:
nginx.conf
#user nobody; worker_processes 8; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; events { worker_connections 1024; } http { include ../mime.types; default_type application/octet-stream; #log_format main '$remote_addr - $remote_user [$time_local] "$request" ' # '$status $body_bytes_sent "$http_referer" ' # '"$http_user_agent" "$http_x_forwarded_for"'; #access_log logs/access.log main; sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; server { listen 8066; server_name ip; location / #设定访问静态文件直接读取不经过tomcat { root /etc/nginx/dist/; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } server { listen 8011; server_name ip; location / #设定访问静态文件直接读取不经过tomcat { root /etc/nginx/jy_dist/; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } server { listen 8166; server_name ip; location / #设定访问静态文件直接读取不经过tomcat { root /etc/nginx/gy_dist/; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } server { listen 8222; server_name ip; location / #设定访问静态文件直接读取不经过tomcat { root /etc/nginx/rz_dist/rz_dist/; index index.html index.htm; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } }
nginx常用命令:
nginx -s stop 快速关闭Nginx,可能不保存相关信息,并迅速终止web服务。 nginx -s quit 平稳关闭Nginx,保存相关信息,有安排的结束web服务。 nginx -s reload 因改变了Nginx相关配置,需要重新加载配置而重载。 nginx -s reopen 重新打开日志文件。 nginx -c filename 为 Nginx 指定一个配置文件,来代替缺省的。 nginx -t 不运行,而仅仅测试配置文件。nginx 将检查配置文件的语法的正确性,并尝试打开配置文件中所引用到的文件。 nginx -v 显示 nginx 的版本。 nginx -V 显示 nginx 的版本,编译器版本和配置参数。
windows下脚本:startup.bat
@echo off rem 如果启动前已经启动nginx并记录下pid文件,会kill指定进程 nginx.exe -s stop rem 测试配置文件语法正确性 nginx.exe -t -c conf/nginx.conf rem 显示版本信息 nginx.exe -v rem 按照指定配置去启动nginx nginx.exe -c conf/nginx.conf
好记性不如烂笔头
浙公网安备 33010602011771号