1

I have a website running on a VM on Proxmox.

Public IP -> Host Proxmox -> Private IP of the VM

https -> Certificate SSL given by the Host Proxmox -> http on the private IP of the VM

On the client side (from outside) all is ok.

On the server side (admin of Wordpress), I get some cURL error 7 :

Failed to connect to mysitename.com port 443 : Connection refused

I think on the server side, wordpress admin tries to reach https://mysitename.com from the VM .... which run under http

My etc/host files (on the VM) is :

127.0.0.1       localhost mysitename.com
::1             localhost ip6-localhost ip6-loopback
ff02::1         ip6-allnodes
ff02::2         ip6-allrouters
# --- BEGIN PVE ---
10.10.2.30 mysitename.com mysitename
# --- END PVE ---

What should I change in my configuration to autorize https connection from and to the local VM (which did not have the https certificate) ?

Thanks a lot !

Community
  • 1
  • 1
G.Lebret
  • 2,826
  • 2
  • 16
  • 27

2 Answers2

1

I finally find how to proceed :

On the VM, where Wordpress is running, I added on the wp-config.php file :

if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') $_SERVER['HTTPS']='on';

Then Wordpress, is able to connect to itself from the VM

G.Lebret
  • 2,826
  • 2
  • 16
  • 27
0

The Connection Refused error indicates https (port 443) can't be reached. Double-check your firewall / port forwarding rules to make sure both 80 and 443 are forwarded to your private IP. It's best practice to only use 443 but this depends on other factors.

If you haven't setup an SSL certificate for your WordPress install yet, you may get started by using free certificates from the https://letsencrypt.org/ project.

MagicFab
  • 168
  • 10