Polymer Starter Kit - Pretty URL on Nginx Server

The Polymer Starter Kit (PSK) provides instructions for using Pretty URLs when hosted on Firebase HERE

I am trying to do this using Nginx Server, but I cannot determine the location block to reload the page. Using the sample data that comes with the PSK, how can you configure "/ users / sam" for example.

+4
source share
1 answer

Nginx configuration

server {
  listen 80;
  server_name example.com;
  root /home/myuser/psk/dist;
  index index.html;

  location /
  {
    try_files $uri /index.html;
  }
}

URL index.html. Polymer starter nginx URL- , http://example.com/users/Chuck, "" PSK 1.2.x

<html>
  <head>
    <base href="/">
    ...

nginx URL.

nginx error.log

"/index.html"

, .

SyntaxError: <

+10

Source: https://habr.com/ru/post/1623693/


All Articles