Skip to main content

All Questions

Filter by
Sorted by
Tagged with
0 votes
0 answers
175 views

How to put URL/$directory into rewrite url parameter in NGINX?

What I need is to pass as a parameter what comes after the slash. https://example.com/berlin to https://example.com/index.php?c=berlin So far for testing I had done it like this: location / berlin { ...
Carlos Vázquez's user avatar
1 vote
1 answer
796 views

How to rewrite randomly generated nginx path by taking the first segment?

I have a prestashop instance that generates a random URL for admin access. The only rule is that the path starts with "admin". The following rule works just fine, but its hardcoded by hand: location ...
Bartłomiej Sobieszek's user avatar
1 vote
1 answer
1k views

Nginx URL rewrite for api/rest to rest/v1

Current API end points are like domain.com/api/rest/[actual_module_routing_path, eg. cms/page/home] In the new system this has to be something like domain.com/rest/V1/$1 It has to work regardless ...
Elamurugan's user avatar
  • 3,204
0 votes
0 answers
139 views

Nginx rewrite doesn't work with typical extensions

I have a nginx rewrite location conf like this location /playernew { error_log /home/heyka/rewrite-error.log debug; if ($request_filename ~ /playernew/([A-Za-z0-9_-]+)/(.+)){ rewrite /...
Krystian Walicki's user avatar
0 votes
0 answers
761 views

Nginx Rewrite rule not working for POST Request

I have an nginx server setup with this configuration: location /company { rewrite ^/company$ /company/ redirect; rewrite ^/company/login$ /company/login/ redirect; rewrite ^/company/(.*) /admin/...
Veer Shrivastav's user avatar
0 votes
1 answer
727 views

Nginx forward with URL rewrite and proxy_pass

I am looking for help in nginx configuration while forwarding request to another domain . Proxy scenarios: https://service1.com/downloads -> https://service2.com/app/downloads https://service1....
code1234's user avatar
  • 121
0 votes
1 answer
11k views

How to get current rewrited URL in Nginx?

Here is my nginx's configuration file: http { index index.html; server { server_name www.domain1.com; access_log logs/domain1.access.log main; root /var/www/domain1.com/htdocs; ...
Wei Yu's user avatar
  • 119
0 votes
1 answer
30 views

nginx rewrite rule haven't result

I try to use nginx's rewrite for changing urls like <domain>/index.php?mode=a/b to <domain>/a/b but my attemps haven't result. location / { rewrite ^(.*)$ index....
XPL's user avatar
  • 1
1 vote
1 answer
244 views

NGINX rewrite condition issues

I have a location on my nginx server like /folder/. In that folder there are .jpg files and a .php script. What I am trying to achieve is the following: When a user accesses a url like: http://...
Bogdan Stoica's user avatar