下载
http://nginx.org/en/download.html
命令
启动Nginx:
nginx.exe start
快速停止或关闭Nginx:
nginx.exe -s stop
正常停止或关闭Nginx:
nginx.exe -s quit
配置文件修改重装载命令:
nginx.exe -s reload
强制停用
第一步:查询进程
tasklist | findstr nginx
第二步:杀掉进程(pid是进程号)
tskill [pid]
配置文件:
监听端口:9090
后端地址:localhost:8080
前端地址:localhost:9600
server {
listen 9090;
server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
location / {
add_header Access-Control-Allow-Origin '*' always;
add_header 'Access-Control-Allow-Credentials' 'true';
add_header Access-Control-Allow-Methods 'GET, POST, PATCH, DELETE, PUT, OPTIONS';
add_header 'Access-Control-Allow-Headers' '*';
if ($request_method = 'OPTIONS') {
return 204;
}
proxy_pass http://localhost:8080;
}
------------------下边未改动