Self-hosted as subpath. Got 404

Dear All.

I try to install taiga from source. All component including rabbitMQ and PGSQL in a single VM.
I want taiga accessed as sub-path, with access scheme http.

VM IP is 192.168.1.70 and My station is at 192.168.12.26.

When I Try to access http://192.168.1.70) /taiga/api/v1/ , JSON is showed like expected.
But when I try to access http://192.168.1.70/taiga or /taiga/ I got HTTP 404

Here is some of my configuration

  1. /etc/nginx/nginx.conf

    user www-data;
    worker_processes auto;
    pid /run/nginx.pid;
    include /etc/nginx/modules-enabled/*.conf;

    events {
	    worker_connections 768;
	    # multi_accept on;
    }

    http {

	    ##
	    # Basic Settings
	    ##

	    sendfile on;
	    tcp_nopush on;
	    types_hash_max_size 2048;
	    # server_tokens off;

	    # server_names_hash_bucket_size 64;
	    # server_name_in_redirect off;

	    include /etc/nginx/mime.types;
	    default_type application/octet-stream;

	    ##
	    # SSL Settings
	    ##

	    ssl_protocols TLSv1 TLSv1.1 TLSv1.2 TLSv1.3; # Dropping SSLv3, ref: POODLE
	    ssl_prefer_server_ciphers on;

	    ##
	    # Logging Settings
	    ##

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

	    ##
	    # Gzip Settings
	    ##

	    gzip on;

	    # gzip_vary on;
	    # gzip_proxied any;
	    # gzip_comp_level 6;
	    # gzip_buffers 16 8k;
	    # gzip_http_version 1.1;
	    # gzip_types text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript;

	    ##
	    # Virtual Host Configs
	    ##

	    include /etc/nginx/conf.d/*.conf;
	    include /etc/nginx/sites-enabled/*;
    }

Note : I already add www-data to taiga group. just to make sure it have ‘read access’ to all files under /home/taiga

  1. /etc/nginx/sites-available/default

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

            large_client_header_buffers 4 32k;
            client_max_body_size 50M;
            charset utf-8;

	    root /var/www/html;

	    # Add index.php to the list if you are using PHP
	    index index.html index.htm index.nginx-debian.html;

	    server_name _;

	    location / {
		    # First attempt to serve request as file, then
		    # as directory, then fall back to displaying a 404.
		    try_files $uri $uri/ =404;
	    }




        # Frontend
        location /taiga/ {
            alias /home/taiga/taiga-front-dist/dist/;
            index index.html;
            try_files $uri $uri/ index.html =404;
            access_log /home/taiga/logs/nginx.access.log;
            error_log /home/taiga/logs/nginx.error.log;
        }

        # API
        location /taiga/api/ {
            access_log /home/taiga/logs/nginx.access.log;
            error_log /home/taiga/logs/nginx.error.log;
            proxy_set_header Host $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Scheme $scheme;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://127.0.0.1:8001/api/;
            proxy_redirect off;
        }

        # Admin
        location /taiga/admin/ {
            access_log /home/taiga/logs/nginx.access.log;
            error_log /home/taiga/logs/nginx.error.log;
            proxy_set_header Host $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Scheme $scheme;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://127.0.0.1:8001/admin/;
            proxy_redirect off;
        }

        # Static files
        location /taiga/static/ {
            access_log /home/taiga/logs/nginx.access.log;
            error_log /home/taiga/logs/nginx.error.log;
            alias /home/taiga/taiga-back/static/;
        }

        # Media
        location /taiga/_protected/ {
            internal;
            access_log /home/taiga/logs/nginx.access.log;
            error_log /home/taiga/logs/nginx.error.log;
            alias /home/taiga/taiga-back/media/;
            add_header Content-disposition "attachment";
        }

        # Unprotected section
        location /taiga/media/exports/ {
            alias /home/taiga/taiga-back/media/exports/;
            add_header Content-disposition "attachment";
            access_log /home/taiga/logs/nginx.access.log;
            error_log /home/taiga/logs/nginx.error.log;
        }

        location /taiga/media/ {
            proxy_set_header Host $http_host;
            proxy_set_header X-Real-IP $remote_addr;
            proxy_set_header X-Scheme $scheme;
            proxy_set_header X-Forwarded-Proto $scheme;
            proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
            proxy_pass http://127.0.0.1:8003/;
            proxy_redirect off;
            access_log /home/taiga/logs/nginx.access.log;
            error_log /home/taiga/logs/nginx.error.log;
        }

        # Events
        location /taiga/events {
            proxy_http_version 1.1;
            proxy_set_header Upgrade $http_upgrade;
            proxy_set_header Connection "upgrade";
            proxy_connect_timeout 7d;
            proxy_send_timeout 7d;
            proxy_read_timeout 7d;
            proxy_pass http://127.0.0.1:8888/events;
            access_log /home/taiga/logs/nginx.access.log;
            error_log /home/taiga/logs/nginx.error.log;
        }

    }

  1. /home/taiga/taiga-front-dist/dist/conf.json

    {
        "api": "http://192.168.1.70/taiga/api/v1/",
        "eventsUrl": "wss://192.168.1.70/taiga/events",,
        "baseHref": "/taiga/",
        "eventsMaxMissedHeartbeats": 5,
        "eventsHeartbeatIntervalTime": 60000,
        "eventsReconnectTryInterval": 10000,
        "debug": false,
        "debugInfo": false,
        "defaultLanguage": "en",
        "themes": [
            "taiga"
        ],
        "defaultTheme": "taiga",
        "defaultLoginEnabled": true,
        "publicRegisterEnabled": true,
        "feedbackEnabled": true,
        "supportUrl": "https://community.taiga.io/",
        "privacyPolicyUrl": null,
        "termsOfServiceUrl": null,
        "maxUploadFileSize": null,
        "contribPlugins": [],
        "tagManager": {
            "accountId": null
        },
        "tribeHost": null,
        "enableAsanaImporter": false,
        "enableGithubImporter": false,
        "enableJiraImporter": false,
        "enableTrelloImporter": false,
        "gravatar": false,
        "rtlLanguages": [
            "ar",
            "fa",
            "he"
        ]
    }


  1. /home/taiga/taiga-front-dist/dist/index.html ; head portion only
    
    <head>
    <meta charset="utf-8">
    <meta http-equiv="content-type" content="text/html; charset=utf-8">
    <meta name="fragment" content="!">
    <base href="/taiga/">
    <!-- Main meta-->
    <title>Taiga</title>
    <meta name="description" content="Taiga is a project management platform for startups and agile developers &amp; designers who want a simple, beautiful tool that makes work truly enjoyable.">
    <meta name="keywords" content="agile, scrum, taiga, management, project, developer, designer, user experience">
    <link rel="stylesheet" href="v-1712171376723/styles/theme-taiga.css">
    <link rel="icon" type="image/png" href="v-1712171376723/images/favicon.png">
    <script type="text/javascript">
      window.prerenderReady = false;
      window.TAIGA_VERSION = 'v-1712171376723';
      window.TAIGA_USER_PILOT_TOKEN = ''
      window._taigaAvailableThemes = ["taiga"];
      
    </script>
    </head>

Kindly please tell me what to check or what to do to fix this problem

Hi there!

Did you add the user www-data to the taiga group, or did you add the taiga user to www-data group?

Could you share a ls -lah of taiga-front-dist?

Best regards!

I really appreciate your response

I added ‘www-data’ to ‘taiga’ group


    root@taiga-project:/home/taiga/taiga-front-dist# cat /etc/group |grep taiga
    taiga:x:1001:www-data

ls -la of taiga-front-dist


    root@taiga-project:/home/taiga/taiga-front-dist# ls -lah
    total 168K
    drwxrwxr-x  6 taiga taiga 4.0K May 10 15:27 .
    drwxr-x--- 11 taiga taiga 4.0K May 10 15:55 ..
    -rw-rw-r--  1 taiga taiga 1.1K May 10 15:27 AUTHORS.rst
    -rw-rw-r--  1 taiga taiga 2.1K May 10 15:27 CONTRIBUTING.md
    -rw-rw-r--  1 taiga taiga  35K May 10 15:27 DCOLICENSE
    drwxrwxr-x  3 taiga taiga 4.0K May 13 14:54 dist
    -rw-rw-r--  1 taiga taiga 2.0K May 10 15:27 dist.js
    -rwxrwxr-x  1 taiga taiga  248 May 10 15:27 generate.sh
    drwxrwxr-x  8 taiga taiga 4.0K May 10 15:27 .git
    drwxrwxr-x  3 taiga taiga 4.0K May 10 15:27 .github
    -rw-rw-r--  1 taiga taiga   34 May 10 15:27 .gitignore
    drwxrwxr-x  3 taiga taiga 4.0K May 10 15:27 .idea
    -rw-rw-r--  1 taiga taiga  34K May 10 15:27 LICENSE
    -rw-rw-r--  1 taiga taiga    9 May 10 15:27 .node-version
    -rw-rw-r--  1 taiga taiga    9 May 10 15:27 .nvmrc
    -rw-rw-r--  1 taiga taiga  254 May 10 15:27 package.json
    -rw-rw-r--  1 taiga taiga  33K May 10 15:27 package-lock.json
    -rw-rw-r--  1 taiga taiga 2.8K May 10 15:27 README.md

Sincerely
-bino-

Okay, so from your output it seems you added the www-data group to the taiga user and not the other way around.

This allows taiga user to access folders owned by the group www-data, but not the other way around.

Please try adding the group taiga to www-data.

Hope this helps!

It works like a charm!!

I really appreciate your help @Charlie

1 Like