Nginx
先写windows里的 简单使用 后面再不上linux的
安装在任意目录,通过命令:start nginx.exe 启动
重启加载配置文件命令:nginx.exe -s reload
配置
修改conf目录下的nginx.conf文件:
#user nobody; worker_processes 1; #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 80; server_name localhost; #charset koi8-r; #access_log logs/host.access.log main; #error_page 404 /404.html; # redirect server error pages to the static page /50x.html # error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } location /user/ { #请求路径中凡是以/user/开头的请求,转发到指定系统 client_max_body_size 300m; #设置最大的请求体大小,解决大文件上传不了的问题 proxy_connect_timeout 300s; #代理连接超时时间 proxy_send_timeout 300s; #代理发送数据的超时时间 proxy_read_timeout 300s; #代理读取数据的超时时间 proxy_pass http://127.0.0.1:18080; #转发请求 } location / { #上面未匹配到的在这里处理 client_max_body_size 300m; proxy_connect_timeout 300s; proxy_send_timeout 300s; proxy_read_timeout 300s; proxy_pass http://127.0.0.1:18081; #转发请求到server系统 } } }
再有什么,直接按照上面的模板配置就行了

浙公网安备 33010602011771号