You can find useful nginx configuration snippets in below link.
Ref: https://github.com/lebinh/nginx-conf
Ref: https://github.com/lebinh/nginx-conf
/etc/nginx/conf.d called redirect.conf:sudo vi /etc/nginx/conf.d/redirect.conf
server {
listen 80;
server_name www.example.com;
return 301 $scheme://example.com$request_uri;
}
sudo systemctl restart nginx
listen directive should be set to port 443 instead of 80.curl -I http://www.example.com
301 Moved Permanently response, that shows the non-www redirect location, like this:
Output:
HTTP/1.1 301 Moved Permanently
Server: nginx/1.4.6 (Ubuntu)
Date: Mon, 04 May 2015 18:20:19 GMT
Content-Type: text/html
Content-Length: 193
Connection: keep-alive
Location: http://example.com/
server {
listen 80;
server_name example.com;
return 301 $scheme://www.example.com$request_uri;
}
sudo systemctl restart nginx
listen directive should be set to port 443 instead of 80.curl -I http://example.com
301 Moved Permanently response, that shows the www redirect location, like this:
Output:
HTTP/1.1 301 Moved Permanently
Server: nginx/1.4.6 (Ubuntu)
Date: Mon, 04 May 2015 18:20:19 GMT
Content-Type: text/html
Content-Length: 193
Connection: keep-alive
Location: http://www.example.com/
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
Use below command to ignore warnings while generating report. phpcs -n /path_to_directory/ The above command will result only errors and ig...