linuxserver-archive / docker-openvpn-as

DEPRECATED
GNU General Public License v3.0
233 stars 92 forks source link

Can't access openvpn-as #139

Closed king-anduin closed 3 years ago

king-anduin commented 3 years ago

hi guys, I installed your docker version but I can't access it. I have a nginx proxy reverse server. that's the docker ps Screenshot from 2021-01-06 17-05-07

That's docker compose file

version: "2.1"
services:
  openvpn-as:
    image: ghcr.io/linuxserver/openvpn-as
    container_name: openvpn-as
    cap_add:
      - NET_ADMIN
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/London
      - INTERFACE=eth0 #optional
    volumes:
      - /srv/openvpn:/config
    ports:
      - 943:943
      - 9443:9443
      - 1194:1194
    restart: unless-stopped

That's my nginx reverse settings

upstream openvpn {
    server 0.0.0.0:943;
}

server {
    listen 80;
    listen [::]:80;

    server_name xx.com;

    # redirect to https
    return 301 xxx.com;
}

server {
    listen 443 ssl http2;
    listen [::]:443 ssl http2;

    server_name xxx.com;

    access_log /var/log/nginx/openvpn.access.log;
    error_log /var/log/nginx/openvpn.error.log;

    ###****SSL settings for cloudflare****###
    ssl_certificate /srv/cloudlfare/cloudflare.crt;
    ssl_certificate_key /srv/cloudlfare/cloudflare.key;
    ssl_client_certificate /srv/cloudlfare/origin-pull-ca.pem;
    ssl_verify_client on;

    ###****SSL settings end for cloudflare****###

    location / {
    proxy_pass http://openvpn;
    proxy_set_header Host $host;
    proxy_set_header X-Real-IP $remote_addr;
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header X-Forwarded-Proto $scheme;
    }
}

Thats my netstat where you can see it's listening Screenshot from 2021-01-06 17-11-14

I always get just Bad Gateway Error 502 when accessing it. I hope you can help me out here.

github-actions[bot] commented 3 years ago

Thanks for opening your first issue here! Be sure to follow the issue template!

aptalca commented 3 years ago

502 means nginx can't reach the service at the address you used

Closing as this is not a bug, feel free to drop by our discord or forum