# Problem with double slashes in urls with uwsgi and sockets

**URL:** <https://www.ruby-forum.com/t/problem-with-double-slashes-in-urls-with-uwsgi-and-sockets/246235>\
**Category:** NGINX\
**Created:** [September 12, 2013, 10:54pm UTC](https://www.ruby-forum.com/t/problem-with-double-slashes-in-urls-with-uwsgi-and-sockets/246235 "2013-09-12T22:54:21Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sadaf\_N](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/858c86/32.png) [@Sadaf\_N](https://www.ruby-forum.com/u/Sadaf_N)\
**Post date:** [September 12, 2013, 10:54pm UTC](https://www.ruby-forum.com/t/problem-with-double-slashes-in-urls-with-uwsgi-and-sockets/246235/1 "2013-09-12T22:54:21Z")

</div>

I have python app running under uwsgi with nginx. I’m using unix sockets  
to  
connect nginx to uwsgi. My python app is receiving single slashes in  
urls  
that originally had a double slash. For example, if the url is  
[http://localhost:3000/a//b](http://localhost:3000/a//b) , my program gets passed a path\_info with a/b  
instead of a//b.

My location definition looks like this:

```
    location / {
        include uwsgi_params;
        uwsgi_pass unix:///tmp/siteserver.socket;
        }

```

Your help greatly appreciated.

Posted at Nginx Forum:

> **[Problem with double slashes in urls with uwsgi and sockets](https://forum.nginx.org/read.php?2,242823,242823#msg-242823)**
>
> I have python app running under uwsgi with nginx. I'm using unix sockets to connect nginx to uwsgi. My python app is receiving single slashes in urls that originally had a double slash. For example, if the url is http://localhost:3000/a//b , my...

---

<div class="post-metadata">

**Author:** ![mpnally](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/90ced4/32.png) [@mpnally](https://www.ruby-forum.com/u/mpnally)\
**Post date:** [September 13, 2013, 1:23am UTC](https://www.ruby-forum.com/t/problem-with-double-slashes-in-urls-with-uwsgi-and-sockets/246235/2 "2013-09-13T01:23:53Z")

</div>

On Thu, Sep 12, 2013 at 04:53:36PM -0400, mpnally wrote:

Hi there,

> I have python app running under uwsgi with nginx. I’m using unix sockets to  
> connect nginx to uwsgi. My python app is receiving single slashes in urls  
> that originally had a double slash. For example, if the url is  
> [http://localhost:3000/a//b](http://localhost:3000/a//b) , my program gets passed a path\_info with a/b  
> instead of a//b.

uwsgi\_params (probably) contains the line

uwsgi\_param PATH\_INFO $document\_uri;

$document\_uri is described at

> **[Module ngx\_http\_core\_module](http://nginx.org/en/docs/http/ngx_http_core_module.html#variables)**
>
> This directive appeared in version 1.11.8.

Following descriptions and links from there will bring you to the  
merge\_slashes directive.

> **[Module ngx\_http\_core\_module](http://nginx.org/en/docs/http/ngx_http_core_module.html#merge_slashes)**
>
> This directive appeared in version 1.11.8.

Set that to “off” if you want contiguous slashes in the request not to  
become a single slash in this server{} bock.

## f

Francis D. [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)

---

<div class="post-metadata">

**Author:** ![mpnally](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/90ced4/32.png) [@mpnally](https://www.ruby-forum.com/u/mpnally)\
**Post date:** [September 13, 2013, 4:27pm UTC](https://www.ruby-forum.com/t/problem-with-double-slashes-in-urls-with-uwsgi-and-sockets/246235/3 "2013-09-13T16:27:20Z")

</div>

Thanks for excellent reply, Francis. I have not had time yet to try it,  
but  
this looks like it will solve my problem.

Posted at Nginx Forum:

> **[Re: Problem with double slashes in urls with uwsgi and sockets](https://forum.nginx.org/read.php?2,242823,242833#msg-242833)**
>
> I have python app running under uwsgi with nginx. I'm using unix sockets to connect nginx to uwsgi. My python app is receiving single slashes in urls that originally had a double slash. For example, if the url is http://localhost:3000/a//b , my...
