Generation internal links

Hello @kovah,

First of all, thank you for this product.

Describe the bug

I set up LinkAce in the docker container, following the instruction to advanced setup.
LinkAce configuration without SSL.
I am using the proxy. When I am trying to open my LinkAce app for example https://test.mydomain.net it shows the correct page, but the link to the login screen contains the port number (80) for example https://test.mydomain.net:80/login

In this case, I have the following questions:

  1. Why link contains a port number even in case of requested URL doesn’t
  2. Is it possible to generate application links without port numbers?

.env contains the following variables

APP_URL=https://test.mydomain.net
FORCE_HTTPS=true

docker-compose.yml

version: "3"

services:

  # --- MariaDB
  db:
    image: mariadb:10.5
    restart: unless-stopped
    command: mysqld --character-set-server=utf8mb4 --collation-server=utf8mb4_bin
    environment:
      - MYSQL_ROOT_PASSWORD=${DB_PASSWORD}
      - MYSQL_USER=${DB_USERNAME}
      - MYSQL_PASSWORD=${DB_PASSWORD}
      - MYSQL_DATABASE=${DB_DATABASE}
    volumes:
      - db:/var/lib/mysql

  # --- LinkAce Image with PHP 7.4
  app:
    image: linkace/linkace:latest
    restart: unless-stopped
    depends_on:
      - db
    volumes:
      - ./.env:/app/.env
      - linkace_app:/app
      - linkace_logs:/app/storage/logs
      # Remove the hash of the following line if you want to use local backups
      #- ./backups:/app/storage/app/backups

  # --- nginx
  nginx:
    image: bitnami/nginx:1.19
    restart: unless-stopped
    ports:
      - "8080:8080"
      #- "0.0.0.0:443:8443"
    depends_on:
      - app
    volumes:
      - linkace_app:/app
      # Replace `nginx.conf` with `nginx-ssl.conf` and remove the hash from the following line
      # if you want to use HTTPS for this container
      - ./nginx.conf:/opt/bitnami/nginx/conf/server_blocks/linkace.conf:ro
      #- /path/to/your/ssl/certificates:/certs:ro

  # --- Redis
  redis:
    image: bitnami/redis:6.0
    restart: unless-stopped
    environment:
      - REDIS_PASSWORD=${REDIS_PASSWORD}

volumes:
  linkace_app:
  linkace_logs:
  db:
    driver: local

nginx.conf

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;

    # 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";

    # Gzip
    gzip on;
    gzip_vary on;
    gzip_comp_level 8;
    gzip_min_length 256;
    gzip_proxied expired no-cache no-store private auth;
    gzip_types application/javascript application/x-javascript application/xhtml+xml font/woff font/woff2 image/svg+xml image/x-icon text/css text/javascript text/plain text/xml;

    # Location configs
    location / {
        try_files $uri $uri/ /index.php?$query_string;
    }

    # Assets and media files
    location ~* \.(?:css|js|map|scss|jpg|jpeg|png|gif|mp4|woff|woff2|ico|svg|webmanifest)$ {
      expires max;
      access_log off;
      add_header Cache-Control "public";
      try_files $uri =404;
    }

    location = /favicon.ico { access_log off; log_not_found off; }
    location = /robots.txt  { access_log off; log_not_found off; }

    # Error pages
    error_page 404 /index.php;
    error_page 403 /index.php;

    # PHP handling
    location ~ \.php$ {
        fastcgi_pass app:9000;

        try_files $uri /index.php;
        include fastcgi.conf;
        fastcgi_keep_conn on;
        fastcgi_intercept_errors on;
        fastcgi_index index.php;
        fastcgi_read_timeout 300;
    }
}

Thanks in advance for your help!

Hi,

You say you haven’t setup SSL but your .env file contains FORCE_HTTPS=true?

The docs were recently updated, please make sure your web server in front of Linkace has the following configuration:

Thank you for pointing this, I checked both variants, it doesn’t work for me.

The main problem that I am using KeenDNS, I requested which information service sends in mentioned in documentation headers. I will back to you whenever I will have answers.

Thank you!