# Problem for play my custom pages error 401

**URL:** <https://www.ruby-forum.com/t/problem-for-play-my-custom-pages-error-401/244262>\
**Category:** NGINX\
**Created:** [March 12, 2016, 8:31am UTC](https://www.ruby-forum.com/t/problem-for-play-my-custom-pages-error-401/244262 "2016-03-12T08:31:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rafa\_F](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/958977/32.png) [@Rafa\_F](https://www.ruby-forum.com/u/Rafa_F)\
**Post date:** [March 12, 2016, 8:31am UTC](https://www.ruby-forum.com/t/problem-for-play-my-custom-pages-error-401/244262/1 "2016-03-12T08:31:47Z")

</div>

I come to you because I am facing a problem with the customization of  
the  
401 error page in fact I use Nginx and rutorrent, I proceeded as  
follows:

I create a folder named “error\_pages” I placed in the /var/www/  
then I created my pages 400.html 401.html 403.html 404.html 503.html  
50x.html

I created the page “error\_pages.conf”  
(/etc/nginx/conf.d/error\_pages.conf)  
and I placed the code below

error\_page 400 /error\_pages/400.html;  
location = /400.html {  
root /var/www/;  
}

error\_page 401 /error\_pages/401.html;  
location = /401.html {  
root /var/www/;  
auth\_basic off;  
allow all;  
}

error\_page 403 /error\_pages/403.html;  
location = /403.html {  
root /var/www/;  
allow all;  
}

error\_page 404 /error\_pages/404.html;  
location = /404.html {  
root /var/www/;  
auth\_basic off;  
internal;  
}

error\_page 503 /error\_pages/503.html;  
error\_page 500 501 502 504 /error\_pages/50x.html;  
location ^~ /error\_pages {  
root /var/www/;  
internal;  
}

Then in the file “rutorrent.conf” located in the  
“/etc/nginx/sites-enabled”  
the following code:

server {  
listen 443 default\_server ssl http2;  
……  
include /etc/nginx/conf.d/error\_pages.conf;  
.….

I restart nginx services.

But obviously my custom error page is not displayed in place of the  
original  
one and I do not see why.

Can you help me ?

Thank you

Posted at Nginx Forum:

> **[Problem for play my custom pages error 401](https://forum.nginx.org/read.php?2,265260,265260#msg-265260)**
>
> I come to you because I am facing a problem with the customization of the 401 error page in fact I use Nginx and rutorrent, I proceeded as follows: I create a folder named "error\_pages" I placed in the /var/www/ then I created my pages...

---

<div class="post-metadata">

**Author:** ![reaman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e95f7d/32.png) [@reaman](https://www.ruby-forum.com/u/reaman)\
**Post date:** [March 12, 2016, 8:35am UTC](https://www.ruby-forum.com/t/problem-for-play-my-custom-pages-error-401/244262/2 "2016-03-12T08:35:53Z")

</div>

## reaman Wrote:

> }  
> auth\_basic off;  
> Then in the file “rutorrent.conf” located in the  
> But obviously my custom error page is not displayed in place of the  
> original one and I do not see why.
> 
> Can you help me ?
> 
> Thank you

Posted at Nginx Forum:  
[https://forum.nginx.org/read.php?2,265260,265261#msg-265261](https://forum.nginx.org/read.php?2,265260,265261#msg-265261)

---

<div class="post-metadata">

**Author:** ![reaman](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/e95f7d/32.png) [@reaman](https://www.ruby-forum.com/u/reaman)\
**Post date:** [March 12, 2016, 8:45am UTC](https://www.ruby-forum.com/t/problem-for-play-my-custom-pages-error-401/244262/3 "2016-03-12T08:45:49Z")

</div>

## reaman Wrote:

> 503.html
> 
> > error\_page 401 /error\_pages/401.html;  
> > }
> > 
> > error\_page 404 /error\_pages/404.html;  
> > location = /404.html {  
> > root /var/www/;  
> > auth\_basic off;  
> > internal;  
> > }
> > 
> > error\_page 503 /error\_pages/503.html;  
> > location = /503.html {  
> > root /var/www/;  
> > auth\_basic off;  
> > internal;  
> > }

> > ```
> > listen 443 default_server ssl http2;
> > 
> > ```
> > 
> > Thank you

Posted at Nginx Forum:  
[https://forum.nginx.org/read.php?2,265260,265263#msg-265263](https://forum.nginx.org/read.php?2,265260,265263#msg-265263)
