I have an instance of nginx running on ports 80 and 443, and I would like to use openvpn with the port 443 in sharing.
So in my server.conf I have this
port 443
port-share 127.0.0.1 4433
proto tcp
;proto udp
And in my nginx.conf
http {
log_format main '$remote_addr - $remote_user [$time_local] "$request" '
'$status $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
access_log /var/log/nginx/access.log main;
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 65;
types_hash_max_size 2048;
client_max_body_size 2M;
include /etc/nginx/mime.types;
default_type application/octet-stream;
# Load modular configuration files from the /etc/nginx/conf.d directory.
# See http://nginx.org/en/docs/ngx_core_module.html#include
# for more information.
include /etc/nginx/conf.d/*.conf;
# OpenVPN
server {
listen 4433;
}
}
But when I start nginx daemon first, the openvpn service can't boot with the error :
Mon Jan 18 13:36:19 2016 us=761548 TCP/UDP: Socket bind failed on local address [undef]: Address already in use
And if I start openvpn first, nginx returns :
[emerg] 5301#0: bind() to 0.0.0.0:443 failed (98: Address already in use)
I don't understand why the port-share feature doesn't work.
listen 443
.