Today I set up a self-signed SSL certificate for my Wordpress sites via my Cent OS Nginx VPS. Because I want to use HTTPS only for Wordpress backend.
This is my vhost nginx configuration file (file in here). After I reload the nginx, now this site only works HTTPS. HTTP display Unable to connect error.
Then I run a telnet command via SSH, then it shows following output.
root@host [~]# telnet mysitename.com 80 Trying 199.1xxx.xxx.22... telnet: connect to address 199.1xxx.xxx.22: Connection refused
I didn't block the port 80. If I disabled CSF, nothing happens. If I removed following codes in sites-enabled config file both HTTP and HTTPS are working. (I don't know how much it's secure and correct)
listen 199.1xxx.xxx.22:443 ssl; ssl on; ssl_certificate /opt/pifpm/ssl/server.crt; ssl_certificate_key /opt/pifpm/ssl/server.key;
Could someone please tell me how do I use both HTTP and HTTPS in this virtual host? Is it secure removed above SSL certificate codes from my site's nginx configuration file and use HTTPS (because SSL working without that settings codes)?