@Olivier_Baillon wrote:
Hi,
After upgrading my discourse installation to discourse 2, all the forum give a 404 error.
Discourse is installed on a docker container.
Forum is serve under subfolder url
https://www.domain.com/forumHere is my host nginx config
server { listen 443 ssl http2; listen [::]:443 ssl http2; server_name www.domain.com; root /home/forge/www.domain.com/public; # FORGE SSL (DO NOT REMOVE!) ssl_certificate /etc/nginx/ssl/www.domain.com/194605/server.crt; ssl_certificate_key /etc/nginx/ssl/www.domain.com/194605/server.key; ssl_protocols TLSv1 TLSv1.1 TLSv1.2; ssl_ciphers 'ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256 :kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE- ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-S HA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA'; ssl_prefer_server_ciphers on; ssl_dhparam /etc/nginx/dhparams.pem; # add_header X-Frame-Options "SAMEORIGIN"; # add_header X-XSS-Protection "1; mode=block"; # add_header X-Content-Type-Options "nosniff"; index index.html index.htm index.php; charset utf-8; # FORGE CONFIG (DOT NOT REMOVE!) include forge-conf/www.domain.com/server/*; location / { try_files $uri $uri/ /index.php?$query_string; } location = /favicon.ico { access_log off; log_not_found off; } location = /robots.txt { access_log off; log_not_found off; } access_log off; error_log /var/log/nginx/www.domain.com-error.log error; error_page 404 /index.php; location ~ \.php$ { fastcgi_split_path_info ^(.+\.php)(/.+)$; fastcgi_pass unix:/var/run/php/php7.1-fpm.sock; fastcgi_index index.php; include fastcgi_params; } location /forum/ { proxy_pass http://unix:/var/discourse/shared/standalone/nginx.http.sock:; proxy_read_timeout 120; proxy_set_header Host $http_host; proxy_http_version 1.1; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-Proto $scheme; } location ~ /\.ht { deny all; } }
and here is my app.yml
## this is the all-in-one, standalone Discourse Docker container template ## ## After making changes to this file, you MUST rebuild ## /var/discourse/launcher rebuild app ## ## BE *VERY* CAREFUL WHEN EDITING! ## YAML FILES ARE SUPER SUPER SENSITIVE TO MISTAKES IN WHITESPACE OR ALIGNMENT! ## visit http://www.yamllint.com/ to validate this file as needed templates: - "templates/postgres.template.yml" - "templates/redis.template.yml" - "templates/web.template.yml" - "templates/web.ratelimited.template.yml" ## Uncomment these two lines if you wish to add Lets Encrypt (https) #- "templates/web.ssl.template.yml" #- "templates/web.letsencrypt.ssl.template.yml" - "templates/web.socketed.template.yml" ## which TCP/IP ports should this container expose? ## If you want Discourse to share a port with another webserver like Apache or nginx, ## see https://meta.discourse.org/t/17247 for details expose: # - "80:80" # http # - "443:443" # https - "2222:22" - "5432:5432" params: db_default_text_search_config: "pg_catalog.french" ## Set db_shared_buffers to a max of 25% of the total memory. ## will be set automatically by bootstrap based on detected RAM, or you can override db_shared_buffers: "8192MB" ## can improve sorting performance, but adds memory usage per-connection #db_work_mem: "40MB" ## Which Git revision should this container use? (default: tests-passed) #version: tests-passed env: LANG: fr_FR.UTF-8 DISCOURSE_DEFAULT_LOCALE: fr ## How many concurrent web requests are supported? Depends on memory and CPU cores. ## will be set automatically by bootstrap based on detected CPUs, or you can override UNICORN_WORKERS: 12 ## TODO: The domain name this Discourse instance will respond to DISCOURSE_HOSTNAME: www.domain.com DISCOURSE_RELATIVE_URL_ROOT: /forum ## Uncomment if you want the container to be started with the same ## hostname (-h option) as specified above (default "$hostname-$config") #DOCKER_USE_HOSTNAME: true ## 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: 'admin@domain.com' ## TODO: The SMTP mail server used to validate new accounts and send notifications DISCOURSE_SMTP_ADDRESS: smtp.mailgun.org DISCOURSE_SMTP_PORT: 587 DISCOURSE_SMTP_USER_NAME: postmaster@domain.com DISCOURSE_SMTP_PASSWORD: "azerty" DISCOURSE_SMTP_ENABLE_START_TLS: false # (optional, default true) ## If you added the Lets Encrypt template, uncomment below to get a free SSL certificate #LETSENCRYPT_ACCOUNT_EMAIL: me@example.com ## The CDN address for this Discourse instance (configured to pull) ## see https://meta.discourse.org/t/14857 for details #DISCOURSE_CDN_URL: //discourse-cdn.example.com ## The Docker container is 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 ## Plugins go here ## see https://meta.discourse.org/t/19157 for details hooks: after_code: - exec: cd: $home/plugins cmd: - git clone https://github.com/discourse/docker_manager.git - git clone https://github.com/discourse/discourse-spoiler-alert.git - git clone https://github.com/Kelio---/discourse-replayer.git - git clone https://github.com/davidtaylorhq/discourse-whos-online.git - git clone https://github.com/discourse/discourse-bbcode.git - git clone https://github.com/discourse/discourse-bbcode-color.git ## Second part to change according to the howto on "Subfolder support with Docker" run: - exec: cd: $home cmd: - mkdir -p public/forum - cd public/forum && 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 ^/(.*)$ /forum/$1 break; proxy_pass http://discourse; - replace: filename: /etc/nginx/conf.d/discourse.conf from: etag off; to: | etag off; location /forum { rewrite ^/forum/?(.*)$ /$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;}'
Thanks you for your help
Posts: 23
Participants: 7