Let's say you want to host domains first.com
and second.com
.
Create folders for their files:
server { | |
listen 80; | |
server_name <URL> <www.URL>; | |
root /var/www/encoder; | |
index index.php; | |
charset utf-8; | |
location = /favicon.ico { access_log off; log_not_found off; } | |
location = /robots.txt { access_log off; log_not_found off; } |
server { | |
listen 80; | |
server_name <domain> <www.domain>; | |
root /var/www; | |
index index.php; | |
charset utf-8; | |
location = /favicon.ico { access_log off; log_not_found off; } | |
location = /robots.txt { access_log off; log_not_found off; } |
############ Config to harden Nginx running Wordpress sites | |
# Paste this in a new file like: /etc/nginx/conf.wp/harden-wordpress.conf | |
# in main/vhost config add: include /etc/nginx/conf.wp/harden-wordpress.conf; | |
# | |
# Restart nginx and voila. This gist is based on: | |
# https://gist.github.com/nfsarmento/57db5abba08b315b67f174cd178bea88 | |
# | |
############ WordPress #################### | |
# Disable logging for favicon and robots.txt |