nginx url rewrite with www and none www

ssl + adds www
return 301 https://www.$host$request_uri;
this redirect makes all https
return 301 https://$host$request_uri;

Full Config with this example

 

server {
listen 80 default_server;

return 301 https://www.$host$request_uri;

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

# Make site accessible from http://localhost/
server_name localhost;

}
server {
listen 443 ssl;
server_name localhost;
ssl on;

ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_prefer_server_ciphers on;
ssl_ciphers AES256+EECDH:AES256+EDH:!aNULL;

ssl_certificate /etc/nginx/ssl/sant.crt; #you have to put here…
ssl_certificate_key /etc/nginx/ssl/san.key; # …paths to your certificate files
return 301 https://www.$host$request_uri;
}

 

 

 

NGINX traffic monitoring

Ich habe zwei Tools gefunden

ngxtop ein Python Tool , was relativ schnell Übersicht bringt

Monitor Nginx Real-time Metrics on Linux/Ubuntu in FREE

 

Sowie goaccess das auch mit fast allen Logfiles umgehen kann

http://vujade.co/monitoring-nginx/

https://goaccess.io/features

https://github.com/allinurl/goaccess

 

Puppet module for /etc/fstab mounts

armen movsesjans's avatarawaseroot

Puppet has a native module for handling fstab mounts. Here is an example:

class data_mounted {
    mount { "/data":
        device  => "/dev/sdb1",
        fstype  => "ext4",
	ensure  => "mounted",
	options => "defaults",
        atboot  => "true",
    }
}

The “device” directive can take anything what you’d normally put in the first column of /etc/fstab, i.e. if you are mounting by label (which is probably the best way to mount partitions) then instead of “/dev/sdb1” call for “LABEL=data”, where ls -l /dev/disk/by-label/data should point to the actual [and existing] partition, which in my case is /dev/sdb1.

The “fstype” is the actual type of the partition, if you are not sure of the type you can check it with df -T. You can mount linux ext partitions, nfs, samba, 9p etc.

For more on fstab file system types and mount options check http://linux.die.net/man/8/mount

View original post