{"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-726413829", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 726413829, "node_id": "MDEyOklzc3VlQ29tbWVudDcyNjQxMzgyOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-12T23:52:50Z", "updated_at": "2020-11-12T23:54:16Z", "author_association": "OWNER", "body": "Hmm... it's not just the `.csv` and `.json` export links - it's the column headings (which can be clicked to change the sort order) as well. Here's an extract of the HTML from that page:\r\n```html\r\n
This data as \r\n json, \r\n CSV (\r\n advanced)\r\n
\r\n\r\n Link\r\n | \r\n\r\n rowid \u25bc\r\n | \r\n\r\n PARSE_EXCEPTION_ID\r\n | \r\n\r\n PARSE_EXCEPTION_DESCRIPTION\r\n | \r\n
---|---|---|---|
\r\n 1\r\n | \r\n1 | \r\n0 | \r\nRUNTIME | \r\n
\r\n 2\r\n | \r\n2 | \r\n1 | \r\nENCRYPTION | \r\n
\r\n 3\r\n | \r\n3 | \r\n2 | \r\nACCESS_PERMISSION | \r\n
\r\n 4\r\n | \r\n4 | \r\n3 | \r\nUNSUPPORTED_VERSION | \r\n
JSON shape:\r\n default,\r\n array,\r\n newline-delimited\r\n
\r\n \r\n\r\n home /\r\n corpora-metadata\r\n
\r\n```\r\nI've also been unable to replicate this in my own local environment, running `datasette fixtures.db --config base_url:/datasette/`.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 742011049, "label": ".json and .csv exports fail to apply base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-726415019", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 726415019, "node_id": "MDEyOklzc3VlQ29tbWVudDcyNjQxNTAxOQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-12T23:56:23Z", "updated_at": "2020-11-12T23:56:23Z", "author_association": "OWNER", "body": "@tballison is there any chance you're running any custom templates in that installation? I'm really confused as to why I can't replicate the bug.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 742011049, "label": ".json and .csv exports fail to apply base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-726415991", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 726415991, "node_id": "MDEyOklzc3VlQ29tbWVudDcyNjQxNTk5MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-12T23:59:34Z", "updated_at": "2020-11-12T23:59:34Z", "author_association": "OWNER", "body": "The sort headers are generated by this template code: https://github.com/simonw/datasette/blob/5eb8e9bf250b26e30b017d39a392c33973997656/datasette/templates/_table.html#L11-L15\r\n\r\nThe export links use this code:\r\n\r\nhttps://github.com/simonw/datasette/blob/5eb8e9bf250b26e30b017d39a392c33973997656/datasette/templates/table.html#L134\r\n\r\nhttps://github.com/simonw/datasette/blob/5eb8e9bf250b26e30b017d39a392c33973997656/datasette/templates/table.html#L180-L201", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 742011049, "label": ".json and .csv exports fail to apply base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-726416330", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 726416330, "node_id": "MDEyOklzc3VlQ29tbWVudDcyNjQxNjMzMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-13T00:00:43Z", "updated_at": "2020-11-13T00:00:43Z", "author_association": "OWNER", "body": "Here's where `url_csv` comes from: https://github.com/simonw/datasette/blob/11eb1e026f3d84cb771f8d6e204939cbaee130cd/datasette/views/base.py#L542-L545", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 742011049, "label": ".json and .csv exports fail to apply base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-727233553", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 727233553, "node_id": "MDEyOklzc3VlQ29tbWVudDcyNzIzMzU1Mw==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-14T16:46:52Z", "updated_at": "2020-11-14T16:46:52Z", "author_association": "OWNER", "body": "@tballison could I see the section of your Apache config that configures the proxying to `/datasette/`?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 742011049, "label": ".json and .csv exports fail to apply base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-728262974", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 728262974, "node_id": "MDEyOklzc3VlQ29tbWVudDcyODI2Mjk3NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-11-16T19:05:08Z", "updated_at": "2020-11-16T19:05:08Z", "author_association": "OWNER", "body": "I have a hunch that there may be some extra configuration in play here - could Apache itself be rewriting some of the links using [mod_proxy_html](https://httpd.apache.org/docs/2.4/mod/mod_proxy_html.html)?", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 742011049, "label": ".json and .csv exports fail to apply base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-741992106", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 741992106, "node_id": "MDEyOklzc3VlQ29tbWVudDc0MTk5MjEwNg==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-09T19:19:54Z", "updated_at": "2020-12-09T20:27:45Z", "author_association": "OWNER", "body": "Could you try removing the `ProxyPassReverse /datasette http://0.0.0.0:8001` line?\r\n\r\nMy hunch is that `ProxyPassReverse` is rewriting some of the links in the HTML (or maybe in the HTTP headers) in a way that breaks things.\r\n\r\nNormally you would need `ProxyPassReverse` to compensate for the underlying application being unable to rewrite its links - but Datasette's `base_url` setting causes Datasette to rewrite all of the links for you, so `ProxyPassReverse` should be unneccessary.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 742011049, "label": ".json and .csv exports fail to apply base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-742023541", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 742023541, "node_id": "MDEyOklzc3VlQ29tbWVudDc0MjAyMzU0MQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2020-12-09T20:17:54Z", "updated_at": "2020-12-09T20:17:54Z", "author_association": "OWNER", "body": "OK that is really weird. I'll have another go at replicating this locally.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 742011049, "label": ".json and .csv exports fail to apply base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-756453010", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 756453010, "node_id": "MDEyOklzc3VlQ29tbWVudDc1NjQ1MzAxMA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-07T23:39:58Z", "updated_at": "2021-01-07T23:40:25Z", "author_association": "OWNER", "body": "@tballison I think that's the solution! It looks like you need to use this in your config:\r\n\r\n`ProxyPass /datasette http://127.0.0.1:8001/datasette`\r\n\r\nInstead of this:\r\n\r\n`ProxyPass /datasette http://127.0.0.1:8001/`\r\n\r\nGive that a go and let me know if it fixes it.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 742011049, "label": ".json and .csv exports fail to apply base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-756453945", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 756453945, "node_id": "MDEyOklzc3VlQ29tbWVudDc1NjQ1Mzk0NQ==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-07T23:42:50Z", "updated_at": "2021-01-07T23:42:50Z", "author_association": "OWNER", "body": "@henry501 it looks like you spotted a bug in the documentation - I just addressed that, the fix is now live here: https://docs.datasette.io/en/latest/deploying.html#running-datasette-behind-a-proxy", "reactions": "{\"total_count\": 1, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 1, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 742011049, "label": ".json and .csv exports fail to apply base_url"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1091#issuecomment-758283074", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1091", "id": 758283074, "node_id": "MDEyOklzc3VlQ29tbWVudDc1ODI4MzA3NA==", "user": {"value": 9599, "label": "simonw"}, "created_at": "2021-01-11T23:12:46Z", "updated_at": "2021-01-11T23:12:46Z", "author_association": "OWNER", "body": "Fantastic!", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 742011049, "label": ".json and .csv exports fail to apply base_url"}, "performed_via_github_app": null}