[PR #1043] [MERGED] fix: webroot not working in archive view #944

Closed
opened 2026-02-25 23:35:58 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/go-shiori/shiori/pull/1043
Author: @edsu
Created: 12/30/2024
Status: Merged
Merged: 12/31/2024
Merged by: @fmartingr

Base: masterHead: archive-webroot


📝 Commits (1)

  • f57e0cd Set webroot base in archive view

📊 Changes

1 file changed (+4 additions, -3 deletions)

View changed files

📝 internal/view/archive.html (+4 -3)

📄 Description

Setting the base URL is required for the archived page to render properly when a --webroot is in use.

I tested the use of the webroot by running a local nginx configured to be a reverse proxy (see configuration below) and then running shiori:

go run main.go server --webroot shiori --port 8081

Prior to the fix my archived page looks like this:

Screenshot 2024-12-30 at 2 05 52 PM

And with the fix it looks like this:

Screenshot 2024-12-30 at 2 06 16 PM

I tested without --webroot and confirm that behavior still works.

nginx config

I tested on MacOS by installing nginx brew install nginx and then editing /opt/homebrew/etc/nginx/nginx.conf to look like:

worker_processes  1;

events {
    worker_connections  1024;
}

http {
    include       mime.types;
    default_type  application/octet-stream;
    sendfile        on;
    keepalive_timeout  65;

    server {
        listen       8080;
        server_name  localhost;

        location / {
            root   html;
            index  index.html index.htm;
        }

        location /shiori/ {
          proxy_pass http://localhost:8081/;
        }

        error_page   500 502 503 504  /50x.html;
        location = /50x.html {
            root   html;
        }
    }

    include servers/*;
}

Fixes #1042


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/go-shiori/shiori/pull/1043 **Author:** [@edsu](https://github.com/edsu) **Created:** 12/30/2024 **Status:** ✅ Merged **Merged:** 12/31/2024 **Merged by:** [@fmartingr](https://github.com/fmartingr) **Base:** `master` ← **Head:** `archive-webroot` --- ### 📝 Commits (1) - [`f57e0cd`](https://github.com/go-shiori/shiori/commit/f57e0cdca748192dae2e7723437340829b8b8375) Set webroot base in archive view ### 📊 Changes **1 file changed** (+4 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `internal/view/archive.html` (+4 -3) </details> ### 📄 Description Setting the base URL is required for the archived page to render properly when a `--webroot` is in use. I tested the use of the webroot by running a local nginx configured to be a reverse proxy (see configuration below) and then running shiori: ```shell go run main.go server --webroot shiori --port 8081 ``` Prior to the fix my archived page looks like this: ![Screenshot 2024-12-30 at 2 05 52 PM](https://github.com/user-attachments/assets/6a5e2f9b-4198-46f5-9a10-cae65c22fd67) And with the fix it looks like this: ![Screenshot 2024-12-30 at 2 06 16 PM](https://github.com/user-attachments/assets/5060aae5-bb0f-44ba-ba2f-dc90b3df8c87) I tested without `--webroot` and confirm that behavior still works. ## nginx config I tested on MacOS by installing nginx `brew install nginx` and then editing `/opt/homebrew/etc/nginx/nginx.conf` to look like: ```nginx worker_processes 1; events { worker_connections 1024; } http { include mime.types; default_type application/octet-stream; sendfile on; keepalive_timeout 65; server { listen 8080; server_name localhost; location / { root html; index index.html index.htm; } location /shiori/ { proxy_pass http://localhost:8081/; } error_page 500 502 503 504 /50x.html; location = /50x.html { root html; } } include servers/*; } ``` Fixes #1042 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-25 23:35:58 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/shiori#944
No description provided.