Welcome! Log In Create A New Profile

Advanced

rewrite c /app/555 на /#app/555

July 26, 2016 12:38PM
Задача:

nginx должен менять урл /app/555 на /#app/555 и отправлять на бекенд сервер.

Текущая конфигурация nginx:

server {
listen 80;
server_name www.mydomain.com;
location / {
proxy_pass http://my-backend;
}

location /app/ {
rewrite ^/(.*)$ "/\\#$1" break;
proxy_pass http://my-backend;
}
}

Nginx выдает вот такую ошибку:

Bad request For request 'GET /\%23app/1' [Illegal character in path at index 1: /\%23app/1]


Подскажите как правильно экранировать символ "#" ?
Subject Author Posted

rewrite c /app/555 на /#app/555

rurik July 26, 2016 12:38PM

Re: rewrite c /app/555 на /#app/555

Konstantin Baryshnikov July 26, 2016 08:40PM

Re: rewrite c /app/555 на /#app/555

rurik July 27, 2016 04:21AM

Re: rewrite c /app/555 на /#app/555

rurik July 27, 2016 04:31AM

Re: rewrite c /app/555 на /#app/555

rurik July 27, 2016 04:55AM

Re: rewrite c /app/555 на /#app/555

Konstantin Baryshnikov July 27, 2016 01:48PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 158
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready