Skip to content

Just obtained a new SSL certificate, but the browser shows connection is not secure

Solved Hosting
  • @phenomlab Thanks very much for sharing the copy of an NGINX config. I tried to replace the IP and domain with my IP and domain. But it returned with " nginx: configuration file /etc/nginx/nginx.conf test failed" when I save the config file.

    location ~ \.php$  {
    		try_files $uri $fastcgi_script_name =404;
    		fastcgi_pass localhost:8000;
    		#fastcgi_pass unix:/run/php/php8.0-fpm.sock;
    		gzip on;
    		gzip_comp_level 5;
    	}
    

    The previous block is

    location ~ \.php(/|$) {
                    try_files $uri $fastcgi_script_name =404;
                    fastcgi_pass unix:/var/php-nginx/163072439048555.sock/socket;
            }
    

    I am using Php 7.4 should I remain the previous block? I noticed there is php8.0-fpm.sock.

    Then I only changes one line in /etc/nginx/sites-available/mysite01.conf

    include /home/user/public_html/.nginx.conf; 
    
    

    It doesn’t work too. Then my Database lost connection.

  • @ash3t said in Just obtained a new SSL certificate, but the browser shows connection is not secure:

    I am using Php 7.4 should I remain the previous block? I noticed there is php8.0-fpm.sock.

    The command for PHP8.0 is prefix by a hash, so will be ignored.

    Try using fastcgi_pass unix:/run/php/php7.4-fpm.sock; and place a # before the fastcgi_pass localhost:8000; line

    The previous block is

    That socket number is auto assigned to the domain when you create it, so it may make more sense to use that. So, something like this

    location ~ \.php$ {
                    try_files $uri $fastcgi_script_name =404;
                    fastcgi_pass unix:/var/php-nginx/163072439048555.sock/socket;
            }
    

    Or

    location ~ \.php$ {
                    try_files $uri $fastcgi_script_name =404;
                    fastcgi_pass unix:/run/php/php7.4-fpm.sock;
            }
    

    It doesn’t work too. Then my Database lost connection.

    Can you clarify this part ?

  • @Ash3T one other thing that sprung to mind - which mode is PHP running in - FCGID or PHP-FPM ? Shouldn’t make too much difference at this stage, but ideally needs to be PHP-FPM.

  • @phenomlab Thanks very much for your reply. I am really busy these days, and I don’t have time to look more into this. Sorry for the late reply. I will give it a try the other day, and make a note of the details, and keep you posted. Thanks again for your kindness.

    By the way, I cannot use the emoji button, there is no emoji after I click on it. Not sure if this happens to everyone or it is just me.

  • @ash3t There isn’t an emoji button here like there was in Flarum. Is that what you’re referring to, or was it something that used to work, but no longer does ?

  • @phenomlab there is one on my screen, please see this screen shot.

  • @ash3t yes, I see what you mean now. It does appear to be broken. Let me look into that. Meanwhile, you can still use standard ASCII emojis like this one 🙂

  • @phenomlab 😄 Yes. I can send out emoji now.

    I started over and got stuck again, here is my config file, could you please take a look?

    server {
    	server_name domain.com www.domain.com;
    	listen 147.1*2.154.2*3:443;
    	root /home/haobao/public_html;
        index index.php index.htm index.html;
    	access_log /var/log/virtualmin/haobao.gq_access_log;
    	error_log /var/log/virtualmin/haobao.gq_error_log;
    	fastcgi_param GATEWAY_INTERFACE CGI/1.1;
    	fastcgi_param SERVER_SOFTWARE nginx;
    	fastcgi_param QUERY_STRING $query_string;
    	fastcgi_param REQUEST_METHOD $request_method;
    	fastcgi_param CONTENT_TYPE $content_type;
    	fastcgi_param CONTENT_LENGTH $content_length;
    	fastcgi_param SCRIPT_FILENAME /home/haobao/public_html$fastcgi_script_name;
    	fastcgi_param SCRIPT_NAME $fastcgi_script_name;
    	fastcgi_param REQUEST_URI $request_uri;
    	fastcgi_param DOCUMENT_URI $document_uri;
    	fastcgi_param DOCUMENT_ROOT /home/haobao/public_html;
    	fastcgi_param SERVER_PROTOCOL $server_protocol;
    	fastcgi_param REMOTE_ADDR $remote_addr;
    	fastcgi_param REMOTE_PORT $remote_port;
    	fastcgi_param SERVER_ADDR $server_addr;
    	fastcgi_param SERVER_PORT $server_port;
    	fastcgi_param SERVER_NAME $server_name;
    	fastcgi_param PATH_INFO $fastcgi_path_info;
    	fastcgi_param HTTPS $https;
    	fastcgi_split_path_info ^(.+\.php)(/.+)$;
    	location ~ \.php(/|$) {
    		try_files $uri $fastcgi_script_name =404;
    		fastcgi_pass unix:/var/php-nginx/163323042750871.sock/socket;
    	}
        location /cgi-bin/ {
    		gzip off;
    		root /home/haobao/cgi-bin;
    		fastcgi_pass unix:/var/fcgiwrap/163323105555833.sock/socket;
    		fastcgi_param SCRIPT_FILENAME /home/haobao$fastcgi_script_name;
    	}
    	listen 147.1*2.154.2*3:443 ssl;
    	ssl_certificate /home/haobao/ssl.combined;
    	ssl_certificate_key /home/haobao/ssl.key;
    	fastcgi_read_timeout 60;
    }
    

    I tried to add: “/flarum/public/” in the following two places
    root /home/haobao/public_html;
    root /home/haobao/cgi-bin;

    It shows: “403 Forbidden” or "No input file specified. "

  • @ash3t I just figured out the mistake I made on the previous config. Now the config is working now. Thanks a lot. I couldn’t edit my previous post. Your working copy of the NGINX config really helps. Thanks a lot.

  • phenomlabundefined phenomlab has marked this topic as solved on
  • @ash3t Great 🙂 Glad everything has worked out.

  • phenomlabundefined phenomlab unlocked this topic on

Did this solution help you?
Did you find the suggested solution useful? Why not buy me a coffee? It's a nice gesture, and a great way to show your appreciation 💗

Related Topics
  • Is no cpanel on host normal?

    Solved Hosting
    8
    3 Votes
    8 Posts
    540 Views

    @Panda if just seems bizarre practice to me. They clearly state that cPanel comes with the package, yet don’t seem to offer it unless you complain it’s missing!

  • 3 Votes
    6 Posts
    595 Views

    @DownPW said in Nginx core developer quits project in security dispute, starts “freenginx” fork:

    Maybe virtualmin implement it in the future…

    I don’t think they will - my guess is that they will stick with the current branch of NGINX. I’ve not personally tested it, but the GIT page seems to be very active. This is equally impressive

    8ac0d197-68fa-4bd8-bfa3-87237bf8f1f4-image.png

    I think the most impressive on here is the native support of HTTP 3

  • Come back PhP, all is forgiven!

    Hosting
    3
    4 Votes
    3 Posts
    250 Views

    @phenomlab said in Come back PhP, all is forgiven!:

    I used IONOS for a while, and realised that Hetzner provide a much better deal for those experienced with Linux. I know @cagatay, @DownPW and myself all use Hetzner, and I think @Madchatthew (whom I haven’t seen for a while ) was also considering taking their services. There’s an affiliate link below if you’d like to go down that route

    Yep hetzner is very very cool and I haven’t seen before a panel magentment as complete as him : backup, snapshot, add cpu core, ram is easy.

    @phenomlab said in Come back PhP, all is forgiven!:

    Obtaining a VPS comes with the double-edged sword of being completely on your own with no support, although by using Virtualmin, you’ll find life so much simpler (something I know @DownPW can attest to, as I managed to convert him )

    Yep Virtualmin is very cool 😉
    And it makes life much easier for server management, domain, nginx and so on even if it is always better to know how to do all this in CLI. I would say that the 2 are really complementary

  • How to check my website is opening in all countries or not?

    Solved Hosting
    3
    2 Votes
    3 Posts
    387 Views

    @phenomlab developing an own app is a big time-consuming job, above tool worked perfectly to run quick sample tests.

    i have used temp mail to log in.

    thanks

  • Domain name factors

    Hosting
    16
    1 Votes
    16 Posts
    879 Views

    @phenomlab said in Domain name factors:

    @jac Yes, but don’t forget that Matomo (and most browsers) alike will allow you to “opt out” or not be tracked, so you can’t really rely on these 100%.

    Absolutely, very true pal.

  • Site down

    Solved Hosting
    9
    1 Votes
    9 Posts
    493 Views

    @jac thinking about it, this is probably related to the feature in Nord VPN.
    https://nordvpn.com/features/vpn-kill-switch/

  • Virtualmin Letsencrypt Renewal

    Solved Hosting
    13
    1 Votes
    13 Posts
    1k Views

    @gotwf said in Virtualmin Letsencrypt Renewal:

    I favor KISS engineering

    Then I think you’ll be able to appreciate this
    https://content.sudonix.com/keep-it-simple-stupid/

  • 3 Votes
    4 Posts
    564 Views

    @cagatay same here. Was previously an IONOS user, but moved to Hetzner to realise both savings and performance increase and have never looked back.