1

I have OpenVPN configured to sent non-VPN traffic on port 443 to my nginx server on port 4433. When I go to https://domain.tld:4433 it works, although https://domain.tld (Where OpenVPN listens on port 443 TCP) results in an "Page not available" (ERR_CONNECTION_CLOSED in Chrome).

OpenVPN config:

port 443
proto tcp
port-share localhost 4433

Nginx config: (Not actually required, because I'm sure it works)

server {
    listen      1.2.3.4:4433;
    server_name domain.tld www.domain.tld;
    ssl         on;
    ssl_certificate      /home/rick/conf/web/ssl.domain.tld.pem;
    ssl_certificate_key  /home/rick/conf/web/ssl.domain.tld.key;
    error_log  /var/log/apache2/domains/domain.tld.error.log error;
    ...
}
  • Is OpenVPN traffic behaving as expected? – austinian Jul 17 '15 at 0:04
  • Also, have you tried using 127.0.0.1 or 1.2.3.4 instead of localhost? – austinian Jul 17 '15 at 0:17
  • @austinian VPN is as it has to be... localhost and 127.0.0.1 I did. Just tried public IP and it works. Thanks :) – Rick Bakker Jul 17 '15 at 0:24
  • Is this issue only affecting chrome? – austinian Jul 17 '15 at 0:28
  • @austinian, No, It didn't work on every browser. I just showed Chrome error because I didn't knew I did translate the error sentence correctly. Now it works... – Rick Bakker Jul 17 '15 at 0:28
0

This is how I solved it:

  1. Check whether OpenVPN is listening on Port 443 TCP. Check according to the config, as well as an port check service.
  2. Set port-share to port-share {IP} {PORT}

How to know the {IP} and {PORT}?

In nginx:

server {
    listen      {IP}:{PORT};
}

In Apache:

<VirtualHost {IP}:{PORT}>
    ServerName {IP} 
    ServerAlias {IP} 
// Could also be an hostname, hostname also work on OpenVPN port-share.
// When {IP} in the VirtualHost opening tag is "*", using localhost or 
// 127.0.0.1 or Public IP in OpenVPN, will fix the problem.
</VirtualHost>

Hope this helped you out!

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.