nginx重新安装 引起的问题
問(wèn)題描述:
今天開(kāi)發(fā)測(cè)試環(huán)境的網(wǎng)站需要做https認(rèn)證,默認(rèn)安裝的nginx沒(méi)有?http_ssl_module?模塊,需要重新加載nginx? 安裝? http_ssl_module ,我采用的是默認(rèn)的安裝腳本重新安裝了一個(gè)新的 結(jié)果安裝好后? 在本地綁定hosts域名后訪問(wèn)是正常的頁(yè)面? 但是在外面的代理服務(wù)器上訪問(wèn)是nginx的默認(rèn)訪問(wèn)頁(yè)面。
?
經(jīng)過(guò)分析得知??
是由于新安裝的nginx的nginx.conf頁(yè)面是默認(rèn)的 ,里面有這么一段和我自己定義的server_name 起了沖突,nginx服務(wù)默認(rèn)讀取的是nginx.conf里面的配置,所以導(dǎo)致了代理服務(wù)器上顯示的訪問(wèn)頁(yè)面是默認(rèn)的nginx訪問(wèn)頁(yè)面。
server {
listen 80;
 server_name localhost;
#charset koi8-r;
#access_log logs/host.access.log main;
 location / {
 root html;
 index index.html index.htm;
 }
?
?
解決方法
從新定義nginx.conf 文件? 內(nèi)容如下:
user root ;
worker_processes auto;
worker_cpu_affinity auto;
#crit
error_log /tmp/nginx_error.log crit;
pid /usr/local/nginx/nginx.pid;
worker_rlimit_nofile 51200;
events
{
 use epoll;
 worker_connections 1024;
}
http {
 access_log /tmp/nginx_access.log;
 error_log /tmp/nginx_error.log; 
 include mime.types;
 default_type application/octet-stream;
 charset UTF-8;
 server_names_hash_bucket_size 128;
 client_header_buffer_size 512k;
 large_client_header_buffers 4 512k;
 client_max_body_size 20m;
 sendfile on;
 tcp_nopush on;
 keepalive_timeout 65;
 tcp_nodelay on;
 include /usr/local/nginx/conf.d/*.conf;
}
轉(zhuǎn)載于:https://www.cnblogs.com/pyng/p/9806417.html
總結(jié)
以上是生活随笔為你收集整理的nginx重新安装 引起的问题的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
                            
                        - 上一篇: k8s服务网关ambassador部署
 - 下一篇: 解题:POI 2004 String