我在Ubuntu16.04上运行了apache服务器,它可以很好地处理80以外的端口,我已经转发了端口80,并尝试使用
https://mysite.ddns.net/index.html
和页面无法加载。
如果我将端口更改为8085并转发它,然后尝试使用URL,
`https://mysite.ddns.net:8085/index.html`
那么它就能工作了,只有80端口的问题。
以下是配置文件
ports.conf
# If you just change the port or add more ports here, you will likely also
# have to change the VirtualHost statement in
# /etc/apache2/sites-enabled/000-default.conf
Listen 8075
Listen 80
Listen 443
Listen 80
Listen 80
# vim: syntax=apache ts=4 sw=4 sts=4 sr noet
默认-ssl.conf
ServerAdmin your_email@example.com
DocumentRoot /var/www
ServerName mysite.ddns.net
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
SSLEngine on
SSLCertificateFile /etc/ssl/certs/apache-selfsigned.crt
SSLCertificateKeyFile /etc/ssl/private/apache-selfsigned.key
SSLOptions +StdEnvVars
SSLOptions +StdEnvVars
BrowserMatch "MSIE [2-6]" \
nokeepalive ssl-unclean-shutdown \
downgrade-1.0 force-response-1.0
我已经使用命令允许iptable中的端口。
sudo iptables -A INPUT -p tcp --dport 80 -j ACCEPT
还是不起作用。可能是什么原因。
发布于 2020-07-03 15:11:52
您正在尝试连接到https://mysite.ddns.net。https正在使用端口443。如果您在端口80上配置了https,则必须使用https://mysite.ddns.net:80。
我建议在端口443中使用https。我会在端口80上为http配置第二个vhost,它将所有流量的重定向发送到https。
https://serverfault.com/questions/1023907
复制相似问题