0

I have an Ubuntu 20.04 Focal server running with ufw firewall, nginx running with php8.0-fpm, and all needed packages with MySQL server.

It is all accessible from outside internal network using dynamic domain name.

When I point my domain to it by either the IP address or by the dynamic domain name, I'm getting ERR_CONNECTION_REFUSED; but from the dynamic domain name all loads happily.

I have check access logs and the domain is showing as connecting.

No error logs with nginx. PHP not logging errors eventhough I have it enabled too.

When I first setup nginx I could access the basic HTML page and phpinfo.php located in /var/www/html.

I have now pointed my web server to e107 within /var/www/html/e107

When i set e107 up, I ran the install.php script and could access it from both domain and dynamic domain. Once setup is completed, it then became inaccessible to the domain but works as it should on the dynamic domain name and via public IP.

If I switch the root directory back to /var/www/html and restart nginx, the basic index.html works fine and so does phpinfo.php.

I have spent hours scrolling through forums for a solution and not found any.

I have a feeling that it's PHP related or e107 CMS stopping the access from the domain but I don't know where to start as i haven't been able to find any solutions to similar issues on forums.

Any help would be greatly appreciated.

mforsetti
  • 2,666
  • 2
  • 16
  • 20

2 Answers2

0

nginx config

server configuration

server {

listen 8000 default_server;

listen [::]:8000 default_server;
   
# SSL configuration
#
# listen 444 ssl default_server;
# listen [::]:444 ssl default_server;
#
# Note: You should disable gzip for SSL traffic.
# See: https://bugs.debian.org/773332
#
# Read up on ssl_ciphers to ensure a secure configuration.
# See: https://bugs.debian.org/765782
#
# Self signed certs generated by the ssl-cert package
# Don't use them in a production server!
#
# include snippets/snakeoil.conf;

root /var/www/html/e107;

# Add index.php to the list if you are using PHP
index index.html index.htm index.nginx-debian.html index index.php;

server_name _;

location / {
    # First attempt to serve request as file, then
    # as directory, then fall back to displaying a 404.
    try_files $uri $uri/ =404;
}

# pass PHP scripts to FastCGI server
#
location ~ \.php$ {
    include snippets/fastcgi-php.conf;
#
#   # With php-fpm (or other unix sockets):
    fastcgi_pass unix:/var/run/php/php8.0-fpm.sock;
#   # With php-cgi (or other tcp sockets):
#   fastcgi_pass 127.0.0.1:9001;
            

    }

# deny access to .htaccess files, if Apache's document root
# concurs with nginx's one
#
location ~ /\.ht {
    deny all;
   }
}


# Virtual Host configuration for example.com
#
# You can move that to a different file under sites-available/ and symlink that
# to sites-enabled/ to enable it.
#
#server {
#   listen 85;
#   listen [::]:85;
#
#   server_name example.com;
#
#   root /var/www/example.com;
#   index index.html;
#
#   location / {
#       try_files $uri $uri/ =404;
#     }

#}

the broadband provider is links broadband part of the open fibre network 300mbps download/100mbps upload with an Asus rt-ac87u router its set to automatically get dns

would it be worth trying cloudflare dns?

  • as i said in previous post, when i use plain html and phpinfo.php in route var/www/html folder its accessible from domain name but as soon as i switch over to e107 folder its unaccessible from domain. only dynamic dns i can access it from. i have checked access.log for nginx and can see the domain connecting but not getting any nginx errors when it tries to connect and even though i have set php to log its not logging the errors so don't know whats going on with php if thats causing the issue somewhere – Jonathan furber Feb 28 '21 at 00:25
0

Just checked domain and its now working.

Earlier I went on names.co.uk as I had the forwarding address only entered which wasn't working.

Went to there dns administration side and entered the A field with the public ip address and instead of there dns server entered in dynamic dns name in the cname and given it 9 hours and its now alive