I'm working on putting the website I'm currently working on on my server. When I try to reach it using regular internet connection through cable it works fine. But when I try to connect to my domain using mobile network, I cannot access it except via Firefox. Errors are mainly : "Error connection reset"/"Internet error", etc.
I tried using my mobile as a hotspot to look further into the issue, and even on my computer using mobile network, it only works on Firefox. My website has been built using PHP and Symfony6. I'm using nginx for my web server and this is my configuration :
server {
server_name domainname.xx www.domainname.xx XX.XX.XX.XX;
root path/to/public;
location ~ /.well-known {
allow all;
}
location / {
# try to serve file directly, fallback to index.php
try_files $uri /index.php$is_args$args;
}
location ~ ^/index\.php(/|$) {
fastcgi_pass unix:/var/run/php/php-fpm.sock;
fastcgi_split_path_info ^(.+\.php)(/.*)$;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $realpath_root$fastcgi_script_name;
fastcgi_param DOCUMENT_ROOT $realpath_root;
internal;
}
#listen 80;
listen 443 ssl; # managed by Certbot
ssl_certificate /path/to/certificate/fullchain.pem; # managed by Certbot
ssl_certificate_key /path/to/certificate/privkey.pem; # managed by Certbot
include /etc/letsencrypt/options-ssl-nginx.conf; # managed by Certbot
ssl_dhparam /etc/letsencrypt/ssl-dhparams.pem; # managed by Certbot
}
server {
if ($host = www.domainname.xx) {
return 301 https://$host$request_uri;
} # managed by Certbot
if ($host = domainname.xx) {
return 301 https://$host$request_uri;
} # managed by Certbot
listen 80;
server_name domainname.xx www.domainname.xx XX.XX.XX.XX;
return 404; # managed by Certbot
}
Thank you for any help you can provide me.
If anyone got the same issue, it appeared that it was about IPv6 not configured in my nginx configuration...
I just had to add listen [::]:80
and listen [::]:443
and it worked on mobile networks.