Skip to content
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

url base path #38

Closed
0xded093 opened this issue May 5, 2016 · 5 comments
Closed

url base path #38

0xded093 opened this issue May 5, 2016 · 5 comments

Comments

@0xded093
Copy link

0xded093 commented May 5, 2016

Hi, is it possible to edit the urlbase path for reverse proxy using a path like /darkwire? Thanks

@seripap
Copy link
Collaborator

seripap commented May 5, 2016

Haven't tested this- but in theory, if you're using nginx you can proxy pass an endpoint to the node app.

server {
        listen 80;
        location /darkwire {
             proxy_pass http://localhost:3000
        }
}

@0xded093
Copy link
Author

0xded093 commented May 5, 2016

I tried setting nginx like that but doesn't work, I think the app has to know that every request must include /darkwire.
I tried also to edit app.js routes to that path but something broke (think static stuff doesn't load)

@alanfriedman
Copy link
Collaborator

How about this solution?

Same as above, except add a trailing slash:

server {
    listen 80;

    location = /darkwire {
        return 302 /darkwire/;
    }

    location /darkwire/ {
         proxy_pass http://localhost:3000
    }
}

@ghost
Copy link

ghost commented Feb 6, 2017

I met this problem too, but already solved.
Here is what I modified:

src/app.js
  line 39: return res.redirect(`/darkwire/${id}`);
  line 62: return res.redirect('/darkwire/');
src/js/app.js
  line 12: this._roomId = window.location.pathname.length ? '/'+window.location.pathname.split('/').filter(function(el){ return !!el; }).pop() : null;
  line 14: this._socket = io(this._roomId,{path:'/darkwire/socket.io'});
  line 23: $('input.share-text').val(document.location.protocol + '//' + document.location.host + '/darkwire' + this._roomId);

** darkwire version 1.5.8

@seripap
Copy link
Collaborator

seripap commented Nov 28, 2017

Will be fixed in #26

@seripap seripap closed this as completed Nov 28, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants