Done with nginx . 
First you need to create a .config file on /etc/nginx/conf.d
Something like this :
server {
listen 80;
server_name example.com;
#charset koi8-r;
location / {
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Nginx-Proxy true;
proxy_pass http://127.0.0.1:4567;
proxy_redirect off;
# Socket.IO Support
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
}
}
Then you need to edit 2 lines :
- example.com with your website
- proxy_pass http://127.0.0.1:4567; with your ip adress
Afer edit , save that file and then add that code , same code on this files :
/etc/nginx/sites-available/default
/etc/nginx/sites-enabled/default
For redirect non-www to www or vicee versa , add this code :
server {
listen 80;
server_name example.com;
return 301 http://www.examplee.com$request_uri;
}
Thanks to all 