解决方法有两种:查看哪个程序占用了80端口,将其结束后启动nginx即可让nginx监听其他的未被占用的端口www.zgxue.com防采集请勿采集本网。
nginx.conf配置文件如下
常用端口中, 80 为http服务使用的端口, 443是 https的端口。 如果启用ssl(https服务),nginx(apache)是需要监听443端口。 刚安装完的 nginx, apache ,默认配置文件是 http服务,也就是不带ssl的。 监听80。 如需启用https 需要手动添加SS
反向代理(Reverse Proxy)方式是指以代理服务器来接受internet上的连接请求,然后将请求转发给内部网络上的服务器,并将从服务器上得到的结果返回给internet上请求连接的客户端,此时代理服务器对外就表现为一个服务器。 找到你网站目录这个是
user nginx;worker_processes 1;error_log /var/log/nginx/error.log warn;pid /var/run/nginx.pid;events { worker_connections 1024;}http { include /etc/nginx/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 /var/log/nginx/access.log main; sendfile on; #tcp_nopush on; keepalive_timeout 65; #gzip on; include /etc/nginx/conf.d/*.conf; # 以下属性中以ssl开头的属性代表与证书配置有关,其他属性请根据自己的需要进行配置。 server { listen 443 ssl; #SSL协议访问端口号为443。此处如未添加ssl,可能会造成Nginx无法启动。 server_name localhost; #将localhost修改为您证书绑定的域名,例如:www.example.com。 root html; index index.html index.htm; ssl_certificate /etc/nginx/huashengshu.top.pem; #替换成您证书的文件名。 ssl_certificate_key /etc/nginx/huashengshu.top.key; #替换成您证书的密钥文件名。 ssl_session_timeout 5m; ssl_ciphers ECDHE-RSA-AES128-GCM-SHA256:ECDHE:ECDH:AES:HIGH:!NULL:!aNULL:!MD5:!ADH:!RC4; #使用此加密套件。 ssl_protocols TLSv1 TLSv1.1 TLSv1.2; #使用该协议进行配置。 ssl_prefer_server_ciphers on; location / { root /etc/nginx/hss; #站点目录。 index index.html index.htm; } } server { listen 80; server_name huashengshu.top; rewrite ^(.*)$ https://${server_name}$1 permanent; }}
以前有过类似的问题 可以参考下: https://segmentfault.com/q/1010000006178253/a-1020000006178297
起作用的是
反向代理(Reverse Proxy)方式是指以代理服务器来接受internet上的连接请求,然后将请求转发给内部网络上的服务器,并将从服务器上得到的结果返回给internet上请求连接的客户端,此时代理服务器对外就表现为一个服务器。 找到你网站目录这个是
server { listen 80; server_name huashengshu.top; rewrite ^(.*)$ https://${server_name}$1 permanent; }
看看这个端口被什么进程占用~ 然后杀死进程~~
到此这篇关于nginx 代理80端口转443端口的实现的文章就介绍到这了,更多相关nginx 代理80转443内容请搜索真格学网以前的文章或继续浏览下面的相关文章希望大家以后多多支持真格学网! 您可能感兴趣的文章:nginx反向代理之将80端口请求转发到8080Nginx反向代理一个80端口下配置多个微信项目详解利用Nginx反向代理功能解决WEB网站80端口被封的解决方法nginx下的代理服务器80端口被封的解决方案封80端口应对策略 Nginx反向代理For WIN2003超级傻瓜式配置
你反向代理的服务器和nginx在同一主机上吧,应该是端口冲突了。把被反向代理服务器的端口改了应该就OK了追问能给点有建设性的回答吗?本回答被网友采纳,会有可能被入侵追问能给点有建设性的回答吗?追答看错内容。内容来自www.zgxue.com请勿采集。