Fixing "Site Can't Be Reached - Refused Connect" Error for WordPress and Nextcloud Instances Behind a SWAG Reverse Proxy on Unraid Server
If you have recently added a WordPress instance on your Unraid server and are encountering the error "Site Can't Be Reached - Refused Connect," this article will help you diagnose and resolve the issue. This article also applies to Nextcloud instances running on Unraid servers behind a SWAG reverse proxy.
Context
Unraid is a popular NAS (Network Attached Storage) operating system that supports Docker containers. SWAG (Southwest Agile Group) is a reverse proxy management tool for Unraid that allows you to route traffic to different Docker containers easily. When you use Unraid with SWAG, you might encounter connection errors for your web applications, such as WordPress and Nextcloud.
Key Concepts
- Reverse proxy
- Docker containers
- WordPress
- Nextcloud
- Firewall
- Certificate generation
Diagnosing the Issue
First, you need to determine if the issue is related to the reverse proxy or the Docker container. To do this, access your WordPress or Nextcloud instance using the container's IP address directly in your web browser. To find the container's IP, you can use the following command:
docker inspect --format='{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container\_nameReplace "container\_name" with the name of your WordPress or Nextcloud container. If you can access your website using the container's IP address, the issue is likely related to the reverse proxy configuration.
Fixing the Reverse Proxy Configuration
The following steps will help you ensure your SWAG reverse proxy is configured correctly:
-
Access the SWAG web interface (typically at
https://). -
Check the reverse proxy rules for your WordPress or Nextcloud container. Make sure the domain name, path, and protocol are configured correctly for your web application.
-
Ensure that the SSL certificate for your custom domain is installed and configured correctly in the SWAG UI.
-
Verify that the firewall rules for the SWAG container allow incoming traffic on the necessary ports.
-
Restart the SWAG container to apply any changes.
Additional Troubleshooting Steps
-
Check the logs for SWAG and your WordPress or Nextcloud container for any errors or warnings. This may help you identify any misconfigurations or issues.
-
Try accessing your web application using a different device or network to ensure the issue is not related to your local network configuration.
- To diagnose the issue, check if the web application is accessible via the container's IP address directly.
- To resolve the issue, ensure that the reverse proxy and firewall rules are configured correctly for your web application and SWAG container.
- Additional troubleshooting steps include checking logs, and trying a different device or network to access your web application.
References