-
Notifications
You must be signed in to change notification settings - Fork 135
Reverse Proxy
Jake edited this page Jan 13, 2017
·
6 revisions
Meteor apps can easily be hosted behind an Nginx webserver by configuring a reverse proxy. You should be using an nginx version >= 1.4, for the best support of WebSockets.
Here is an example configuration that uses a custom port and url base:
server {
# [...other configuration...]
location /requests/ {
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $scheme;
proxy_pass http://127.0.0.1:3000;
# For keepalive sessions and WebSockets:
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
# On every application update the name of the CSS and JS files are
# different, so they can be cached indefinitely. However, the root path
# **must not** be cached!
if ($uri != '/requests/') {
expires 30d;
}
}
}
Then you have to launch meteor
with a custom ROOT_URL
:
$ ROOT_URL=http://127.0.0.1:3030/plexrequests meteor
Voilà! You can now access Plex Requests at https://your.domain/plexrequests
You have secured your server with Let's Encrypt right? I recommend the lightweight letsencrypt.sh script.
Reference: