meteor - nginx and meteorjs - how to rewrite the URL to include port? -
i confused on how rewrite url meteorjs requests has http address of http://ip/<lettershere>meteor_js_resource=true
http://ip:3000/<lettershere>meteor_js_resource=true
.
if access site's url:3000, can static files meteor application.
however, if tried nginx configuration file route url:3000
url/someurl
when people access site, don't need 3000 port number, instead /someurl
:
server { listen 0.0.0.0:80; server_name domain.com; location /youtube-channel-search { proxy_set_header x-real-ip $remote_addr; proxy_set_header x-forwarded-for $proxy_add_x_forwarded_for; proxy_set_header host $http_host; proxy_set_header x-nginx-proxy true; proxy_pass http://localhost:3000; proxy_redirect off; proxy_http_version 1.1; proxy_set_header upgrade $http_upgrade; proxy_set_header connection "upgrade"; rewrite http://domain.com http://domain.com:3000 permanent; } }
then error js file cannot found:
this correct, since http://ip/url
not http://ip:3000/url
.
how should rewrite incoming requests add port :3000? thought proxy_pass automatically takes care of this.
thanks
i figured out.
you need change root_url environmental parameter of meteorjs application localhost:3000/youtube-channel-search
.
using same nginx.conf work.
this because of sockjs , static files mapped localhost:3000
, without trailing /youtube-channel-search
.
Comments
Post a Comment