NGINX - Custom 502 Error Page: Difference between revisions

From Wiki.IT-Arts.net
imported>Z
(Created page with "Category:Public_Pages Adapt ''/etc/nginx/sites-available/example.com.conf'' like: <nowiki> server { listen W.X.Y.Z:443 ssl; server_name example.com; if ($host = 'ww...")
 
imported>Z
No edit summary
 
Line 1: Line 1:
[[Category:Public_Pages]]
[[Category:Post-It]]


Adapt ''/etc/nginx/sites-available/example.com.conf'' like:
Adapt ''/etc/nginx/sites-available/example.com.conf'' like:

Latest revision as of 19:37, 27 March 2020


Adapt /etc/nginx/sites-available/example.com.conf like:

server {
	listen W.X.Y.Z:443 ssl;
	server_name example.com;

	if ($host = 'www.example.com' ) {
		rewrite  ^/(.*)$  https://example.com/$1  permanent;
	}
 
	access_log  /var/log/nginx/example.com.access.log;
	error_log  /var/log/nginx/example.com.error.log;
	
	error_page 502 /custom_502_error.html;
	location = /custom_502_error.html {
		internal;
		root /usr/share/nginx/html;
	}

#	root   /usr/share/nginx/html;
	index  index.html index.htm;

...