Discourse docker subfolder bugs and problems

I am trying to set up subfolder discourse I am having a lot of problems setting it up

I used this documentation for installing subfolder discourse

Problems

  1. My first problem was default logo is not working it’s searching the logo on the root directory.


    this problem was solved when i uploaded my own logo

  2. images are getting 404 after rebuilding

  3. avatars are disappearing after restoring the backup and rebuilding

I think the upload section of the subfolder discourse is not working correctly

I have tried to remap but that’s not working

Here’s my app.yml

##   Subfolder support with Docker   https://meta.discourse.org/t/subfolder-support-with-docker/30507

## discourse-terraform Docker configuration template

##

## After making changes to this file, you MUST rebuild for any changes

## to take effect in your live Discourse instance:

##

## /var/discourse/launcher rebuild app

##

## this is the all-in-one, standalone Discourse Docker container template

# You may add rate limiting to by commenting out the ratelimited template.

# Out of the box it allows 12 reqs a second per ip, and 100 per minute per ip

# This is configurable by amending the params in this file

templates:

  - "templates/postgres.template.yml"

  - "templates/redis.template.yml"

  - "templates/web.template.yml"

  - "templates/sshd.template.yml"

## which TCP/IP ports should this container expose?

expose:

  - "1357:80" #change this port to port where you want run discourse # fwd host port 80   to container port 80 (http)

  #- "2222:22" # fwd host port 2222 to container port 22 (ssh)

params:

  db_default_text_search_config: "pg_catalog.english"

  ## Set db_shared_buffers to 1/3 of the memory you wish to allocate to postgres

  ## on 1GB install set to 128MB on a 4GB instance you may raise to 1GB

  db_shared_buffers: "512MB"

  #

  ## Which Git revision should this container use? (default: tests-passed)

  #version: tests-passed

env:

  LANG: en_US.UTF-8

  ## TODO: How many concurrent web requests are supported?

  ## With 2GB we recommend 3-4 workers, with 1GB only 2

  UNICORN_WORKERS: 3

  ##

  ## TODO: List of comma delimited emails that will be made admin and developer

  ## on initial signup example 'user1@example.com, user2@example.com'

  DISCOURSE_DEVELOPER_EMAILS: "ahmeds.works@gmail.com" #change these emails to site admins emails

  ##

  ## TODO: The domain name this Discourse instance will respond to

  DISCOURSE_RELATIVE_URL_ROOT: /ask 

  DISCOURSE_HOSTNAME: "privitevps.ga" #change this domain to you website domain

  ##

  ## TODO: The mailserver this Discourse instance will use

  # change smtp setting to your own smtp setting

  DISCOURSE_SMTP_ADDRESS: smtp-relay.example.com

  DISCOURSE_SMTP_PORT: 587

  DISCOURSE_SMTP_USER_NAME: example@gmail.com

  DISCOURSE_SMTP_PASSWORD: smtp_password

##

  ## The CDN address for this Discourse instance (configured to pull)

  #DISCOURSE_CDN_URL: //discourse-cdn.example.com

## These containers are stateless, all data is stored in /shared

volumes:

  - volume:

      host: /var/discourse/shared/standalone

      guest: /shared

  - volume:

      host: /var/discourse/shared/standalone/log/var-log

      guest: /var/log

## The docker manager plugin allows you to one-click upgrade Discouse

## http://discourse.example.com/admin/docker

hooks:

  after_code:

    - exec:

        cd: $home/plugins

        cmd:

          - mkdir -p plugins

          - git clone https://github.com/discourse/docker_manager.git

          - git clone https://github.com/discourse/discourse-voting.git

## Remember, this is YAML syntax - you can only have one block with a name

run:

    - exec:

        cd: $home

        cmd:

          - rm -fr public/assets

          - sudo -E -u discourse bundle exec rake assets:precompile

          - mkdir -p public/ask

          - cd public/ask && ln -s ../uploads && ln -s ../backups

          - rm public/uploads

          - rm public/backups

    - replace:

       global: true

       filename: /etc/nginx/conf.d/discourse.conf

       from: proxy_pass http://discourse;

       to: |

          rewrite ^/(.*)$ /ask/$1 break;

          proxy_pass http://discourse;

    - replace:

       filename: /etc/nginx/conf.d/discourse.conf

       from: etag off;

       to: |

          etag off;

          location /ask {

             rewrite ^/ask/?(.*)$ /$1;

          }

    - replace:

         filename: /etc/nginx/conf.d/discourse.conf

         from: $proxy_add_x_forwarded_for

         to: $http_fastly_client_ip

         global: true

    - exec: echo "End of custom commands"

    - exec: awk -F\# '{print $1;}' ~/.ssh/authorized_keys | awk 'BEGIN { print "Authorized SSH keys for this container:"; } NF>=2 {print $NF;}'

here’s my Nginx config

    location /ask {
        proxy_pass      http://localhost:1357/ask;
        proxy_read_timeout      90;
        proxy_redirect  http://localhost:1357/ask https://privitevps.ga/ask;
    }

@neil can you plz help me install discourse on the subdirectory without any error

1 Like