Score:0

Safari can't open my http link to my website

ni flag

So I have a basic Nginx configuration that redirects any request to my site to www and HTTPS:

server {
    listen 80;
    listen [::]:80;
    server_name www.goodjobs.ro goodjobs.ro;
    return 301 https://www.goodjobs.ro$request_uri;
}

server {
    listen 443 ssl;
    ssl_certificate hidden/path;
    ssl_certificate_key hidden/path;
    server_name goodjobs.ro;
    return 301 https://www.goodjobs.ro$request_uri;
}


server {
        server_name goodjobs.ro www.goodjobs.ro;
        listen 93.188.166.124 http2;
        listen 93.188.166.124:443 ssl http2;
        root /home/goodjobs/public_html;
        index index.php index.htm index.html;
        location ^~ /.well-known/ {
                try_files $uri /;
        }
        location / {
                proxy_pass http://localhost:3000;
                proxy_http_version 1.1;
                proxy_set_header Upgrade $http_upgrade;
                proxy_set_header Connection 'upgrade';
                proxy_set_header Host $host;
                proxy_cache_bypass $http_upgrade;
        }
        ssl_certificate hidden/path;
        ssl_certificate_key hidden/path;
}

nginx.conf

user www-data;
worker_processes auto;
pid /run/nginx.pid;
include /etc/nginx/modules-enabled/*.conf;

events {
        worker_connections 768;
        # multi_accept on;
}

http {

        ##
        # Basic Settings
        ##

        sendfile on;
        tcp_nopush on;
        tcp_nodelay on;
        keepalive_timeout 65;
        types_hash_max_size 2048;
        # server_tokens off;
 
        # server_names_hash_bucket_size 64;
        # server_name_in_redirect off;
 
        include /etc/nginx/mime.types;
        default_type application/octet-stream;
 
        ##
        # SSL Settings
        ##
 
        ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
        ssl_prefer_server_ciphers on;
 
        ##
        # Logging Settings
        ##
 
        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;
 
        ##
        # Gzip Settings
        ##
 
        gzip on;
 
        # gzip_vary on;
        # gzip_proxied any;
        # gzip_comp_level 6;
        # gzip_buffers 16 8k;
        # gzip_http_version 1.1;
        # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;
 
        ##
        # Virtual Host Configs
        ##
 
        include /etc/nginx/conf.d/*.conf;
        include /etc/nginx/sites-enabled/*;
        server_names_hash_bucket_size 64;
}

On chrome, it works perfectly, but on safari, it doesn't

Behavior on Safari:

If I type the URL normally or with http://, the website doesn't work. But if I type it with https://, it loads

My theory is that safari doesn't get the http redirect (first server block)

And chrome and Mozilla get it

vidarlo avatar
ar flag
Don't redact the domain. If you include the domain we can easily check how the server behaves.
Alex Totolici avatar
ni flag
Done, now the domain is visible
vidarlo avatar
ar flag
I don't know nginx very well, but the problem is that your webserver is talking TLS on port 80. It should only talk TLS on port 443, and plain HTTP on port 80. Why? Someone who knows nginx should answer... :)
sv flag
Your site works fine on Safari for me.
Alex Totolici avatar
ni flag
I fixed it. the problem was that i listened to port 80 and had http2 enabled (`listen 80 http2;`)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.