首页天道酬勤端口转发面板,linux下nginx安装配置

端口转发面板,linux下nginx安装配置

张世龙 05-12 16:58 13次浏览

在构成nginx传输路由的Linux上安装nginx

在Linux上安装nginx

解压缩nginx,放在/usr/local/nginx上

安装nginx所需的

yum-yinstallgccpcre-devel zlib-devel OpenSSL-devel执行配置

执行./configure #命令

运行make#makeinstall命令

makeinstall.nginx安装目录-配置文件` ` ` powershell CD/usr/local/nginx/conf创建conf.d文件夹mkdir conf.d首先是nginx.conf

注意:3358 www.Sina.com/# user nobody; 工作器_ processes 1; #error_log logs/error.log; #error_log logs/error.log notice; #error_log logs/error.log info; #pid logs/nginx.pid; 事件{ worker _ connections 1024; }http { include mime.types; include/usr/local/nginx/conf/conf.d/*.conf; efault _ type应用程序/octet-stream; client_max_body_size 100m; proxy_connect_timeout 300s; proxy_send_timeout 300s; proxy_read_timeout 300s; # log _ format main ' $ remote _ addr-$ remote _ user [ $ time _ local ] ' $ request ' # ' $ status $ body _ $ $ sendfile on; #tcp_nopush on; #keepalive_timeout 0; keepalive_timeout 65; #gzip on; 服务器{ listen 80; server_name localhost; #charset koi8-r; # access _ loglogs/host.access.log main; 位置/{根html; 索引索引. html index.htm; } #error_page 404 /404.html; # redirectservererrorpagestothestaticpage/50x.html # error _ page 500502503504/50x.html; location=/50x.html { root html; } # proxythephpscriptstoapachelisteningon 127.0.0.1:80 # # location~. PHP $ { # proxy _ pass 3358127.0.0 } # fastcgi _ pass 127.0.0.1:9000; # fastcgi_index index.php; # fastcgi _ param script _ filename/scripts $ fastcgi _ script _ name; 包括fastcgi _ params; #} # deny access to .htaccess files,if Apache ' sdocumentroot # concurswithnginx ' sone # # location (/).ht ) #denyall; # } #服务器{ # listen 9898; # server _ name 47.103.159.227336017000; # error_page 404 /index.html; #此部署在刷新预防页面后,将在第404页# location/{ # if ($ request _ method=' options ' ) # add _ header access-control-alloration #返回204; # } #根/数据1/hecate-rent/dist; # index index.html index.htm; # error_page 404 /index.html; #此配置在更新预防页面后显示404页# location=/50x.html {# root html; # } # # anothervirtualhostusingmixofip -、name-、and port-based configuration # # server { # listen 8000; #监听器somename :8080; # server _ namesomenamealiasanother.alias; # location/{ # root html; # index index.html index.htm; #}#}#https服务器##服务器{#Listen443SSL; # server_name localhost; # ssl_certificate cert.pem; # ssl_certificate_key cert.key; # SSL _ session _ cache shared : SSL :1 m; # ssl_session_timeout 5m; # ssl_ciphers HIGH: aNULL: MD5; # ssl_prefer_server_ciphers on; # location/{ # root html; # index index.html index.htm; # } #}}在新创建的conf.d文件夹中创建要配置的新项目,如创建aa.conf

注意:主要是跳页404位置/{

try_files $uri $uri//index.html; add _ header access -控制- allow-origin *; ustreambackendtwo { server IP :6009; }服务器{ listen 8013; 服务器_ name IP; try_files $uri $uri//index.html; access _ log/usr/local/nginx/logs/server.access.log; location/{ try _ files $ uri $ uri//index.html; if($request_method='options ' ) add _ header access-control-allow-origin *; add _ header access-control-allow-methods get,POST,PUT,DELETE,OPTIONS; 返回204; }根/数据1/XXX/dist; 索引索引. html index.htm; } location ^~/API/{ proxy _ pass http://IP 33606009/nginx sbin,进入nginx CD/usr/local/nginx/sbin./nginx-s rell

nginx突然不转发请求,nginx打开转发日志信息配置 url地址后面传递参数,nginx地址转发改变url