New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Phoenix routing challenges with a subfolder deployment #296
Comments
The rest of the codebase was ported to Elixir this year, so there's no dual-stack anymore, which should make what you want to achieve easier. It's been a while since you tried setting this up, so I'm not sure if you're still interested in it. I'll close this one, but feel free to re-open and we'll figure it out. |
Hi @sickill, I'm having the same use case as @joshisa. I'm trying to run asciinema-server on http://localhost/asciinema but static files (and websocket?) keep getting served on the root path. I've had a couple attempt at fixing this but having no knowlegde of erlang or elixir, that task has proven to be difficult. My configuration is:
And the fix I tried was: --- a/lib/asciinema_web/endpoint.ex
+++ b/lib/asciinema_web/endpoint.ex
@@ -14,12 +14,15 @@ defmodule AsciinemaWeb.Endpoint do
socket "/socket", AsciinemaWeb.UserSocket,
websocket: true
+ config = Application.get_env(:asciinema, __MODULE__)
+ url = Keyword.get(config, :url)
+
# Serve at "/" the static files from "priv/static" directory.
#
# You should set gzip to true if you are running phx.digest
# when deploying your static files in production.
plug Plug.Static,
- at: "/",
+ at: url[:path],
from: :asciinema,
gzip: true,
only: ~w(css fonts images js favicon.ico robots.txt) I tried a couple of variant without any success at compiling. Any help would be much appreciated. |
I'm trying to setup asciinema under a url with a subfolder of https://x.x.x.x/asciinema . I've been able to find and patch most of the rails portions to allow the home page, all of the non-phoenix links and the player to function normally.
Unfortunately, I'm facing 500 error codes with my "x.x.x.x/asciinema/docs" and my login links. I suspect that i need to make some adjustments within my /lib/asciinema_web/router.ex and maybe my nginx file ... but my debug efforts so far haven't pointed me in the right direction.
I've enabled error_log within the nginx "sites-enabled/default" file. The traffic for "/asciinema/docs" seems to be matching to the phoenix server. Here's a snip:
After the headers are rewritten per the nginx /etc/nginx/sites-enabled/default file - sample below:
Failing Request --> 500 Reponse
Would welcome any hints/guidance. Absolutely love this project!
The text was updated successfully, but these errors were encountered: