NGINX’s default 403 page isn’t very pretty. In this video, learn how to add a custom 403 page.
- [Narrator] Along with using the allow and deny directives,…we can add a custom 403 page.…So even though we might be denying…somebody from viewing a page,…we can still give them something pretty to look at.…First let's create a location that's always denied,…so we can see the default page generated by Nginex.…So let's edit our vhost configuration file.…I'll add a location called /deny…and use the deny all directive.…
Now let's save this and test it out.…And I'll use nginx-t to test the configuration…and reload it with systemctl reload nginx.…Now let's open the browser and try out deny location.…Okay so we see the 403 Forbidden page generated by Nginex.…Let's create a custom 403 page so we don't see…this default page, and create something…that's a little bit more in line with our site.…
Let's edit our vhost configuration file.…You might recall that we already have a configuration…for handling 404 errors.…Let's use that code over again for our 403 errors.…And what I'll do is just replace…the 404s in this section with 403.…
- Installing NGINX on Linux
- Configuring a virtual host
- Installing PHP and MariaDB for the LEMP stack
- Securing sites with NGINX
- Creating SSL certificates
- Reverse proxies
- Load balancing
Skill Level Beginner
DevOps Foundations: Infrastructure as Codewith Ernest Mueller2h 6m Intermediate
1. Install and Configure NGINX
2. The Linux, NGINX, MySQL, and PHP Stack
3. NGINX Security
4. Reverse Proxies and Load Balancers
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.