Description of the Issue
I am trying to setup linkace using the advanced docker setup on a vps which has a local installation of nginx. I am trying to setup a subdomain such as “https://linkace.mydomain.dev”. I already have a wildcard cert for my domain and using the local install of nginx on the vps I already have other apps setup on their respective subdomains. This is the nginx conf I have for linkace on the local install of nginx:
I have replaced the name of my domain with “mydomain” for this post. But everything else is as it appears in the files.
server {
listen 443;
server_name linkace.mydomain.dev;
ssl_certificate /etc/letsencrypt/live/mydomain.dev/fullchain.pem;
ssl_certificate_key /etc/letsencrypt/live/mydomain.dev/privkey.pem;
location / {
proxy_pass http://localhost:9002;
}
}
Besides the directions for modifying .env, I also modified:
APP_URL: http://linkace.mydomain.dev
For docker-compose.yml, I have the nginx config as:
...
nginx:
image: bitnami/nginx:1.19
restart: unless-stopped
ports:
- "0.0.0.0:9002:8080"
#- "0.0.0.0:9002:8443"
depends_on:
- app
volumes:
- linkace_app:/app
- ./nginx.conf:/opt/bitnami/nginx/conf/server_blocks/linkace.conf:ro
#- /etc/letsencrypt/live/mydomain.dev:/certs
...
And I have the nginx.conf as:
server {
root /app/public;
server_name _;
index index.php;
charset utf-8;
client_max_body_size 20M;
port_in_redirect off;
# Choose the connection method
listen 0.0.0.0:8080;
#listen 0.0.0.0:8443 ssl;
# Provide SSL certificates
#ssl_certificate /certs/fullchain.pem;
#ssl_certificate_key /certs/privkey.pem;
# Content security headers for Laravel
add_header X-Frame-Options "SAMEORIGIN";
add_header X-XSS-Protection "1; mode=block";
add_header X-Content-Type-Options "nosniff";
...
If I change settings related to ssl such as the port in the docker-compose-yml and the listen and ssl certificates in the nginx.conf, the port doesn’t get exposed in docker and when i visit my url I get “502 bad gateway”. If I keep all the settings to use http and just leave my local nginx conf as is, I can access linkace at https://linkace.mydomain.dev but all the links within the app use localhost:9002 instead of my domain so none of the assets are loaded correctly and the button don’t work as well.
If I keep the settings to use http in the linkace files I can access linkace using my VPS’s IP with the port 9002 and the app works correctly and all the assets load correctly. But I want to use https and my domain.
I have been playing around with the configuration settings for a couple days now and have not been able to get this setup successfully. What do I need to change to get this working with my url on ssl?
LinkAce setup (please complete the following information):
- Version: 1.2.2
- Installed via: Advanced Docker setup
- OS: Ubuntu