Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Custom Wordpress Location - Error establishing a database connection #544

Open
1 task done
linkthepirate opened this issue Feb 5, 2025 · 21 comments
Open
1 task done

Comments

@linkthepirate
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

Site loads not secure with : Error establishing a database connection

Expected Behavior

Site should load

Steps To Reproduce

I have a docker-compose.yaml which contains my entire stack and network. I have everything in the one directory so all configs are:

./service_name/config:/config

I have used swag since it was called letsencrypt so my folder says that, anyway.

I have wordpress working with the local ip and can access no problem with the actual database connection, edit and publish pages, the works.

I followed this guide: https://docs.linuxserver.io/general/swag/#hosting-a-wordpress-site

I have this volume:

/home/my_admin/apps:/apps

I noticed that when this is declared:

root /config/sites/mydomain.tld/www

the index file is directly under that, it's not the case with my wordpress instance so I modified the root to be:

root /apps/wordpress/var/www/html;

This is after I tried to get around this by using symbolic link. I saw issue 137 but the op never replied. Maybe they did something else entirely, idk.

Environment

- OS: Debian 11 Bullseye
- How docker service was installed: https://docs.docker.com/compose/install/linux/

CPU architecture

x86-64

Docker creation

wordpress:
    container_name: wordpress
    hostname: wordpress
    image: wordpress:6.7-php8.3-apache
    restart: unless-stopped
    environment:
      PUID: $PUID
      PGID: $PGID
      WORDPRESS_DB_HOST: wordpress-db
      WORDPRESS_DB_USER: wordpress
      WORDPRESS_DB_PASSWORD: $WORDPRESS_DF_DB_PASSWORD
      WORDPRESS_DB_NAME: wordpress
    volumes:
      - ./wordpress/var/www/html:/var/www/html
    networks:
      - gate
    ports:
      - 8888:80
    depends_on:
      - wordpress-db
  wordpress-db:  
    container_name: wordpress-db
    image: mariadb:10.6
    restart: unless-stopped
    environment:
      MYSQL_ROOT_PASSWORD: $WORDPRESS_DF_DB_PASSWORD
      MYSQL_DATABASE: wordpress
      MYSQL_USER: wordpress
      MYSQL_PASSWORD: $WORDPRESS_DF_DB_PASSWORD
    volumes:
      - ./wordpress-db/var/lib/mysql:/var/lib/mysql
    networks:
      - gate

Container logs

To support the app dev(s) visit:
Certbot: https://supporters.eff.org/donate/support-work-on-certbot

To support LSIO projects visit:
https://www.linuxserver.io/donate/

───────────────────────────────────────
GID/UID
───────────────────────────────────────

User UID:    1000
User GID:    1000
───────────────────────────────────────
Linuxserver.io version: 3.1.0-ls360
Build-date: 2025-01-25T03:21:46+00:00
───────────────────────────────────────

using keys found in /config/keys
**** The following active confs have different version dates than the samples that are shipped. ****
**** This may be due to user customization or an update to the samples. ****
**** You should compare the following files to the samples in the same folder and update them. ****
**** Use the link at the top of the file to view the changelog. ****
┌────────────┬────────────┬────────────────────────────────────────────────────────────────────────┐
│  old date  │  new date  │ path                                                                   │
├────────────┼────────────┼────────────────────────────────────────────────────────────────────────┤
│ 2023-08-13 │ 2024-12-06 │ /config/nginx/ssl.conf                                                 │
│ 2020-05-23 │ 2024-03-14 │ /config/nginx/authelia-location.conf                                   │
│ 2018-08-10 │ 2022-08-20 │ /config/nginx/ldap-server.conf                                         │
│ 2020-05-23 │ 2024-03-16 │ /config/nginx/authelia-server.conf                                     │
│ 2023-06-05 │ 2024-12-17 │ /config/nginx/site-confs/default.conf                                  │
│ 2023-04-13 │ 2024-12-17 │ /config/nginx/nginx.conf                                               │
└────────────┴────────────┴────────────────────────────────────────────────────────────────────────┘
**** The following site-confs have extensions other than .conf ****
**** This may be due to user customization. ****
**** You should review the files and rename them to use the .conf extension or remove them. ****
**** nginx.conf will only include site-confs with the .conf extension. ****
/config/nginx/site-confs/default.conf.old
Variables set:
PUID=1000
PGID=1000
TZ=$TIMEZONE
URL=domain1.tld
SUBDOMAINS=wildcard
EXTRA_DOMAINS=domain2.tld
ONLY_SUBDOMAINS=false
VALIDATION=dns
CERTPROVIDER=
DNSPLUGIN=$PROVIDER
EMAIL=
STAGING=

Using Let's Encrypt as the cert provider
SUBDOMAINS entered, processing
Wildcard cert for domain1.tld will be requested
EXTRA_DOMAINS entered, processing
Extra domains processed are: domain2.tld
No e-mail address entered or address invalid
dns validation via digitalocean plugin is selected
Certificate exists; parameters unchanged; starting nginx
The cert does not expire within the next day. Letting the cron script handle the renewal attempts overnight (2:08am).
/config/nginx/geoip2.conf exists.
        Please migrate to https://github.com/linuxserver/docker-mods/tree/swag-maxmind
/config/nginx/ldap.conf exists.
        Please apply any customizations to /config/nginx/ldap-server.conf
        Ensure your configs are updated and remove /config/nginx/ldap.conf
        If you do not use this config, simply remove it.
[custom-init] No custom files found, skipping...
[ls.io-init] done.
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/site-confs/default.conf:15
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/site-confs/default.conf:16
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/airsonic.subdomain.conf:7
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/airsonic.subdomain.conf:8
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/audiobookshelf.subdomain.conf:12
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/audiobookshelf.subdomain.conf:13
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/bookstack.subdomain.conf:15
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/bookstack.subdomain.conf:16
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/calibre-web.subdomain.conf:13
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/calibre-web.subdomain.conf:14
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/emby.subdomain.conf:11
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/emby.subdomain.conf:11
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/emby.subdomain.conf:12
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/emby.subdomain.conf:12
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/filebrowser.subdomain.conf:11
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/filebrowser.subdomain.conf:12
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/grocy.subdomain.conf:6
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/grocy.subdomain.conf:6
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/grocy.subdomain.conf:7
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/grocy.subdomain.conf:7
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/guacamole.subdomain.conf:11
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/guacamole.subdomain.conf:12
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/navidrome.subdomain.conf:14
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/navidrome.subdomain.conf:14
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/navidrome.subdomain.conf:15
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/navidrome.subdomain.conf:15
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/nextcloud.subdomain.conf:18
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/nextcloud.subdomain.conf:19
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/ombi.subdomain.conf:10
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/ombi.subdomain.conf:11
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/organizr.subdomain.conf:6
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/organizr.subdomain.conf:6
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/organizr.subdomain.conf:7
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/organizr.subdomain.conf:7
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/photoprism.subdomain.conf:11
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/photoprism.subdomain.conf:12
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/photoprismprv.subdomain.conf:11
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/photoprismprv.subdomain.conf:12
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/photoview.subdomain.conf:12
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/photoview.subdomain.conf:13
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/plex.subdomain.conf:10
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/plex.subdomain.conf:11
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/podgrab.subdomain.conf:6
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/podgrab.subdomain.conf:7
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/tautulli.subdomain.conf:6
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/tautulli.subdomain.conf:7
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/wizarr.subdomain.conf:6
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for 0.0.0.0:443 in /config/nginx/proxy-confs/wizarr.subdomain.conf:6
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/proxy-confs/wizarr.subdomain.conf:7
2025/02/05 17:17:06 [warn] 791#791: protocol options redefined for [::]:443 in /config/nginx/proxy-confs/wizarr.subdomain.conf:7
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/site-confs/domain2.tld.conf:15
2025/02/05 17:17:06 [warn] 791#791: the "listen ... http2" directive is deprecated, use the "http2" directive instead in /config/nginx/site-confs/domain2.tld.conf:16
2025/02/05 17:17:06 [warn] 791#791: conflicting server name "media.*" on 0.0.0.0:80, ignored
2025/02/05 17:17:06 [warn] 791#791: conflicting server name "" on 0.0.0.0:80, ignored
2025/02/05 17:17:06 [warn] 791#791: conflicting server name "media.*" on [::]:80, ignored
2025/02/05 17:17:06 [warn] 791#791: conflicting server name "" on [::]:80, ignored
Copy link

github-actions bot commented Feb 5, 2025

Thanks for opening your first issue here! Be sure to follow the relevant issue templates, or risk having this issue marked as invalid.

@linkthepirate
Copy link
Author

Relevant, the nginx conf, didn't have a spot for it in the initial post.


# redirect all traffic to https
server {
    listen 80; #default_server;
    listen [::]:80; #default_server;
    server_name mydomain.tld www.mydomain.tld;
    location / {
        return 301 https://$host$request_uri;
    }
}

# main server block
server {
    listen 443 ssl http2; # default_server;
    listen [::]:443 ssl http2; # default_server;
    server_name mydomain.tld www.mydomain.tld;
    include /config/nginx/ssl.conf;
    # root /config/www;
    # root /config/sites/mydomain.tld/www;
    root /apps/wordpress/var/www/html;

    index index.html index.htm index.php;
    location / {
        try_files $uri $uri/ /index.html /index.php$is_args$args =404;
        #try_files $uri $uri/ /index.html /index.php$is_args$args;
    }
    location ~ ^(.+\.php)(.*)$ {
      
        fastcgi_split_path_info ^(.+\.php)(.*)$;
        fastcgi_pass 127.0.0.1:9000;
        fastcgi_index index.php;
        include /etc/nginx/fastcgi_params;
    }
    # deny access to .htaccess/.htpasswd files
    location ~ /\.ht {
        deny all;
    }
}
# enable subdomain method reverse proxy confs
# include /config/nginx/proxy-confs/*.subdomain.conf;
# enable proxy cache for auth
# proxy_cache_path cache/ keys_zone=auth_cache:10m;

@j0nnymoe
Copy link
Member

j0nnymoe commented Feb 5, 2025

I'm not entirely sure what you're crossing container paths with wordpress/swag. If you're using their docker container, just edit the nginx config to point at wordpress:80 address rather than trying to load the files directly.

Swag is likely isn't picking up this ENV's because they're not out into a config file that it can read.

@linkthepirate
Copy link
Author

That was the very first thing I did, my wordpress.sudomain(replaced with mydomain).conf

I get "welcome to our server"

## Version 2024/07/16
# make sure that your wordpress container is named wordpress
# make sure that your dns has a cname set for wordpress

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

    server_name mydomain.tld www.mydomain.tld;

    include /config/nginx/ssl.conf;

    client_max_body_size 0;

    # enable for ldap auth (requires ldap-location.conf in the location block)
    #include /config/nginx/ldap-server.conf;

    # enable for Authelia (requires authelia-location.conf in the location block)
    #include /config/nginx/authelia-server.conf;

    # enable for Authentik (requires authentik-location.conf in the location block)
    #include /config/nginx/authentik-server.conf;

    location / {
        # enable the next two lines for http auth
        #auth_basic "Restricted";
        #auth_basic_user_file /config/nginx/.htpasswd;

        # enable for ldap auth (requires ldap-server.conf in the server block)
        #include /config/nginx/ldap-location.conf;

        # enable for Authelia (requires authelia-server.conf in the server block)
        #include /config/nginx/authelia-location.conf;

        # enable for Authentik (requires authentik-server.conf in the server block)
        #include /config/nginx/authentik-location.conf;

        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app wordpress;
        set $upstream_port 80;
        set $upstream_proto http;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    }
}


@j0nnymoe
Copy link
Member

j0nnymoe commented Feb 5, 2025

Is wordpress/swag sharing the same docker network?

@j0nnymoe
Copy link
Member

j0nnymoe commented Feb 5, 2025

It's also worth noting, you're running old nginx configs so might be wise to get those updated.

@linkthepirate
Copy link
Author

Yes

 swag:  # Reverse Proxy - See it's page: https://github.com/linuxserver/docker-swag
    cap_add:
      - NET_ADMIN
    container_name: swag
    environment:
      - VALIDATION=dns
      - DNSPLUGIN=$SWAG_DNS
      - PUID=$PUID
      - PGID=$PGID
      - TZ=$TIMEZONE
      - URL=$SWAG_URL
      - SUBDOMAINS=wildcard
      - ONLY_SUBDOMAINS=false
      - EXTRA_DOMAINS={redacted}
    image: linuxserver/swag:latest #2.7.3 #1.32.0-ls170 # These are other versions I was static on.
    networks:
      - gate
    ports:
      - 443:443/tcp
      - 80:80/tcp
    restart: unless-stopped
    volumes:
      - ./letsencrypt:/config     ## There is a proxy folder with all the sample files. NGINX
      - /home/administrator/apps:/apps

@linkthepirate
Copy link
Author

It's also worth noting, you're running old nginx configs so might be wise to get those updated.

I just removed samples and re-created, it's the same version date.

@linkthepirate
Copy link
Author

I mean I'm assuming that copying the wordpress.subdomain.conf would work, replacing the sudomain logic with my own domain. Please tell me if this is a fundamental inconsistency.

@j0nnymoe
Copy link
Member

j0nnymoe commented Feb 5, 2025

The proxy config is incorrect, subdomain isn't what's needed. Look at our example for Heimdall as root domain, it uses a subfolder conf but you have to adjust it slightly.

@linkthepirate
Copy link
Author

linkthepirate commented Feb 6, 2025

Do I need to update 443 to 80? I changed the name to wordpress, but not sure what else I should do, as I've always use subdomain. I'm sure I have to add my domain somewhere though lol.

## Version 2023/02/05
# make sure that your heimdall container is named heimdall
# In order to use this location block you need to edit the default file one folder up and comment out the / location

location / {
    # enable the next two lines for http auth
    #auth_basic "Restricted";
    #auth_basic_user_file /config/nginx/.htpasswd;

    # enable for ldap auth (requires ldap-server.conf in the server block)
    #include /config/nginx/ldap-location.conf;

    # enable for Authelia (requires authelia-server.conf in the server block)
    #include /config/nginx/authelia-location.conf;

    # enable for Authentik (requires authentik-server.conf in the server block)
    #include /config/nginx/authentik-location.conf;

    include /config/nginx/proxy.conf;
    include /config/nginx/resolver.conf;
    set $upstream_app wordpress;
    set $upstream_port 443;
    set $upstream_proto https;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;

}

@j0nnymoe
Copy link
Member

j0nnymoe commented Feb 6, 2025

Yes you need to change those relevant to the wordpress container.

@linkthepirate
Copy link
Author

Ok I did - still get the welcome to our server message.

@linkthepirate
Copy link
Author

On the cert it still shows my domain 1 btw.

@linkthepirate
Copy link
Author

Any other ideas? Still an issue.

@j0nnymoe
Copy link
Member

j0nnymoe commented Feb 7, 2025

if it's showing the server message, it means something isn't right in your nginx conf as nginx doesn't know what to do with routing it.

@linkthepirate
Copy link
Author

That's why I'm asking for guidance. Not sure where I'm going wrong. I poked around a bit and added my domain to the heimdall config but not really sure what's up at this point

## Version 2023/02/05
# make sure that your heimdall container is named heimdall
# In order to use this location block you need to edit the default file one folder up and comment out the / location
server {
    listen 80; #default_server;
    listen [::]:80; #default_server;
    server_name mydomain.tld www.mydomain.tld;
    location / {
        return 301 https://$host$request_uri;
    }
}

# main server block
server {
    listen 443 ssl http2; # default_server;
    listen [::]:443 ssl http2; # default_server;

    server_name mydomain.tld www.mydomain.tld;

    include /config/nginx/ssl.conf;

    root /apps/wordpress-df/var/www/html;

    index index.html index.htm index.php;

    location / {

        include /config/nginx/proxy.conf;
        include /config/nginx/resolver.conf;
        set $upstream_app wordpress-df;
        set $upstream_port 80;
        set $upstream_proto https;
        proxy_pass $upstream_proto://$upstream_app:$upstream_port;

    }
}

@linkthepirate
Copy link
Author

Update - I got it working but it's only when I put in my main domain - not my domain that is in other domains. It does however append the :PORT that I mapped at the end of the url.

So it's only SWAG_URL that loads - not EXTRA_DOMAINS

Here is my current config:

location / {
    # enable the next two lines for http auth
    # auth_basic "Restricted";
    # auth_basic_user_file /config/nginx/.htpasswd;

    # enable for ldap auth (requires ldap-server.conf in the server block)
    #include /config/nginx/ldap-location.conf;

    # enable for Authelia (requires authelia-server.conf in the server block)
    #include /config/nginx/authelia-location.conf;

    # enable for Authentik (requires authentik-server.conf in the server block)
    #include /config/nginx/authentik-location.conf;

    include /config/nginx/proxy.conf;
    include /config/nginx/resolver.conf;
    set $upstream_app wordpress-df;
    set $upstream_port 80;
    set $upstream_proto http;
    proxy_pass $upstream_proto://$upstream_app:$upstream_port;

}

and my default:

## Version 2024/12/17 - Changelog: https://github.com/linuxserver/docker-swag/commits/master/root/defaults/nginx/site-confs/default.conf.sample

# redirect all traffic to https
server {
    listen 80 default_server;
    listen [::]:80 default_server;

    # # location / {
    # #     return 301 https://$host$request_uri;
    # # }
}

# main server block
server {
    listen 443 ssl default_server;
    listen [::]:443 ssl default_server;

    server_name _;

    include /config/nginx/ssl.conf;

    root /config/www;
    index index.html index.htm index.php;

    # enable subfolder method reverse proxy confs
    include /config/nginx/proxy-confs/*.subfolder.conf;

    # enable for ldap auth (requires ldap-location.conf in the location block)
    #include /config/nginx/ldap-server.conf;

    # enable for Authelia (requires authelia-location.conf in the location block)
    #include /config/nginx/authelia-server.conf;

    # enable for Authentik (requires authentik-location.conf in the location block)
    #include /config/nginx/authentik-server.conf;

    # # location / {
    # #     # enable for basic auth
    # #     #auth_basic "Restricted";
    # #     #auth_basic_user_file /config/nginx/.htpasswd;

    # #     # enable for ldap auth (requires ldap-server.conf in the server block)
    # #     #include /config/nginx/ldap-location.conf;

    # #     # enable for Authelia (requires authelia-server.conf in the server block)
    # #     #include /config/nginx/authelia-location.conf;

    # #     # enable for Authentik (requires authentik-server.conf in the server block)
    # #     #include /config/nginx/authentik-location.conf;

    # #     try_files $uri $uri/ /index.html /index.htm /index.php$is_args$args;
    # # }

    # # location ~ ^(.+\.php)(.*)$ {
    # #     # enable the next two lines for http auth
    # #     #auth_basic "Restricted";
    # #     #auth_basic_user_file /config/nginx/.htpasswd;

    # #     # enable for ldap auth (requires ldap-server.conf in the server block)
    # #     #include /config/nginx/ldap-location.conf;

    # #     # enable for Authelia (requires authelia-server.conf in the server block)
    # #     #include /config/nginx/authelia-location.conf;

    # #     # enable for Authentik (requires authentik-server.conf in the server block)
    # #     #include /config/nginx/authentik-location.conf;

    # #     fastcgi_split_path_info ^(.+\.php)(.*)$;
    # #     if (!-f $document_root$fastcgi_script_name) { return 404; }
    # #     fastcgi_pass 127.0.0.1:9000;
    # #     fastcgi_index index.php;
    # #     include /etc/nginx/fastcgi_params;
    # # }

    # deny access to .htaccess/.htpasswd files
    location ~ /\.ht {
        deny all;
    }
}

# enable subdomain method reverse proxy confs
include /config/nginx/proxy-confs/*.subdomain.conf;

I plan on putting up my wife's website as well so I really need to be able to use EXTRA_DOMAINS

@j0nnymoe
Copy link
Member

You'll likely need to put a new location specific for that domain using the server_name field in your default.conf.

@linkthepirate
Copy link
Author

linkthepirate commented Feb 10, 2025

Ok - so the wordpress subfolder sample says to comment out location and php in default, where would I set that up? I've tried adding my domain as another conf file as well.

@linkthepirate
Copy link
Author

linkthepirate commented Feb 11, 2025

Now all my other proxies are broken. Tried to re-create and now it's saying the keys aren't there. They look to be links.

Edit, got them back. I'm at a loss here. I've given all my configs and have pretty much only gotten "yeah you have to edit that" but WHAT do I edit? WHAT do I need to do? I've followed the docs before even coming here, tried using the samples per directions with no real guidance, and still right back where I started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Issues
Development

No branches or pull requests

2 participants