Monday, 5 March 2018

nginx configuration

server {
        listen 80;
        server_name_in_redirect off;
        root /srv/www/;
        access_log /srv/www/;
        error_log /srv/www/;
        rewrite  ^/$  /andyboot.html  permanent;
        rewrite ^/favicon.ico$ /img/favicon.ico last;
        # Dont expose hidden files to the web
        location ~ /\. {
                return 404;
I want to talk about my old nginx config file.
  • server_name = What urls it should listen to
  • root = where to serve static files from
  • rewrite = These are interesting - if a client asks for X we redirect them to Y instead. - Here it was used in a desperate attempt to get more SEO juice by redirecting / to my name.

No comments:

Post a Comment