Skip to content

Instantly share code, notes, and snippets.

@givanse
Last active February 20, 2021 13:08
Show Gist options
  • Save givanse/fb99c7e68159e16539dc to your computer and use it in GitHub Desktop.
Save givanse/fb99c7e68159e16539dc to your computer and use it in GitHub Desktop.
Nginx + Ember
server {
root /var/www/{Your App Directory Path Here};
index index.html index.htm;
server_name {Your website URL or IP address here};
location / {
try_files $uri $uri/ /index.html?/$request_uri;
}
}
location ~* ^/([A-Za-z0-9-]*)((?:/[A-Za-z0-9-]+)+)$ {
try_files $uri /$1/index.html?/$2;
}
@yaxinr
Copy link

yaxinr commented Feb 20, 2021

for custom rootUrl
build app into /dir/app1

location /app1 {
              root /dir;
              try_files $uri $uri/ /app1/index.html =404;
              break;
            }

or

location /app1 {
              alias /dir/app1;
              try_files $uri $uri/ /index.html =404;
              break;
            }

config\environment.js

module.exports = function (environment) {
  let ENV = {
    rootURL: '/app1/',
................

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment