Getting error for domainXYZ.com:8081

Capture321321321

1. Caddy version (caddy version):

latest

2. How I run Caddy:

Caddy installed on Ubuntu per instructions on the site

a. System environment:

Mint 20, not a docker
command sudo ufw status returns inactive.

b. Command:

paste command here

c. Service/unit/compose file:

paste full file contents here

d. My complete Caddyfile or JSON config:

icolostrum.ga {
reverse_proxy 192.168.1.59:8081
}

paste config here, replacing this text
DO NOT REDACT anything except credentials


### 3. The problem I'm having:
<!-- What are you trying to do, and what isn't working? Please describe the issue thoroughly enough so that anyone can reproduce the exact behavior you're seeing. Be as specific as possible. -->

when I ping icolostrum.ga I get my IP correct
When I open 192.168.1.59:8081 I get the Wordpress page
When I enter icolostrum.ga the web brwser will switch to icolostrum.ga:8081 and it reports proxy firewall problem
Port 80 and 443 is open on my netgear router

### 4. Error messages and/or full log output:
<!-- Please **DO NOT REDACT** any information except credentials. -->



### 5. What I already tried:
<!-- Show us what effort you've put in to solving the problem. Be specific -- people are volunteering their time to help you! Low effort posts are not likely to get good answers! -->



### 6. Links to relevant resources:

If it’s just a basic site you might want to try this;

Maybe you also want to try without a reverse proxy first to make sure the site is working externally. Something like this first to start with;

icolostrum.ga {
	root * /var/www/icolostrum.ga
	php_fastcgi 127.0.0.1:8082
	encode zstd gzip
	file_server
}

or…

icolostrum.ga {
	reverse_proxy 192.168.1.59:8081
	encode zstd gzip
	file_server
}

www.icolostrum.ga {
  redir https://icolostrum.ga{uri}
}

Don’t forget to restart your caddy service after saving that file. If you are running wordpress you would need the php_fastcgi service in there too assuming you have php installed.

thank you zen

I do not have PHP installed , I`m running Wordpress in docker on the same machine as Caddy.

ah in that case you won’t need php if you using docker. Your web server is responding externally. When accessing your domain I get a SSL error so it’s live to the outside for sure. I also get this;

Check your syslog on your server with caddy installed. Might give some indication of where it’s failing. I think it’s just the SSL cert part.

the log is advising me to add TLS config, and I have no idea what it is so will have to check documentation on that

Is there a reason for using docker at all and not just a native web service without docker? It’s a pain in the a55 I hate it when it doesn’t work. Can you open 8081 on your firewall for a sec? see if it’s accessible when the ports opened?

That log looks fine and it’s getting a cert issued.

I`m amateur Linux user, the docker gives my opportunity to remove container and start from scratch.
I took me several iterations to figure our my_sql for Wordpress. Also I can run multiple sites/containers on different port.

Docker is just another layer of complexity but I know where you are coming from I always try to use Linux natively without any fancy addons. Seems to be less issues that way.

port opened and works
http://73.181.52.166:8081/

thank you zen for checking and your help, I will try reinstalling CADDY , maybe remove certificates somehow and restart to trigger new certificates and if not will try NGINX Proxy

I think WordPress needs some rewrite rules in the caddy file as well though. Maybe;

# Prevent malicious PHP uploads from running
@uploads {
  path_regexp path /uploads\/(.*)\.php
}
rewrite @uploads /

@wp-admin {
  path  not ^\/wp-admin/*
}
rewrite @wp-admin {path}/index.php?{query}
file_server
1 Like

will look into it

Someone running caddy here with docker/wordpress;

thank you, there is some config inside Wodpress and when you go through initial setup of Wordpress using local IP it will not pick up / repond to a domain call.

Will try to reinstall the wordpress docker

This topic was automatically closed after 30 days. New replies are no longer allowed.