Just moved my website over from IIS to Linux (LEMP on Ubuntu Server 16.04)
Still learning Linux, and im not sure how to achiveve the following:
I have a website running - lets say www.qwerty.com with google analytics set up for it. Lets say this lives in /var/www/html/qwerty.com/public
I want to create a virtual directory under this site, to serve 2 seperate pages with an embededed video player and video in.
lets say:
www.qwerty.com/videos contains all the files to serve Video #1 and lives in /var/www/html/videos
www.qwerty.com/videos/video2 contains all the files to serve video #2 and lives in /var/www/html/videos/video2
I want to do this as both of these page url's have their own respective individual google analytics code so visitors are tracked uniquely to these pages and not all under qwerty.com.
Do i achieve this by using symlinks for the video1 and video 2 directories pointing to the main /var/www/html/qwerty.com/public directory?
Thanks for your help
SERVER BLOCK ADDED EDIT
fastcgi_cache_path /var/www/html/qwerty.com/cache levels=1:2 keys_zone=QWERTY:100m inactive=60m;
server {
server_name www.qwerty.com
root /var/www/html/qwerty.com/public/;
index index.php index.html index.htm video.html;
location ~ /\. {
deny all;
}
location ~* /(?:uploads|files)/.*\.php$ {
deny all;
}
add_header X-Frame-Options "SAMEORIGIN" always;
add_header X-Content-Type-Options "nosniff" always;
add_header X-Xss-Protection "1; mode=block" always;
location = /robots.txt {
log_not_found off;
access_log off;
}
location = /favicon.ico {
log_not_found off;
access_log off;
}
location ~* \.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(\..*|Entries.*|Repository|Root|Tag|Template)$|\.php_
{
return 444;
}
location ~* ^.+\.(js|css|swf|xml|txt|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|rss|atom|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ {
access_log off;
log_not_found off;
expires max;
}
location ~* \.(pl|cgi|py|sh|lua)\$ {
return 444;
}
location /videos {
root /var/www/html;
}
location /videos/videos2 {
root /var/www/html;
}
set $skip_cache 0;
if ($request_method = POST) {
set $skip_cache 1;
}
if ($query_string != "") {
set $skip_cache 1;
}
if ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") {
set $skip_cache 1;
}
if ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_no_cache|wordpress_logged_in") {
set $skip_cache 1;
}
if ($http_cookie ~* "PHPSESSID"){
set $skip_cache 1;
}
location / {
try_files $uri $uri/ /index.php?$args;
}
location /phpmyadmin {
auth_basic "Admin Login";
auth_basic_user_file /etc/nginx/allow_phpmyadmin;
}
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
location ~* \.(?:manifest|appcache|html?|xml|json)$ {
expires -1;
}
location ~* \.(?:rss|ato)$ {
expires 1h;
add_header Cache-Control "public";
}
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1d;
add_header Cache-Control "public";
log_not_found off;
access_log off;
}
location ~* \.(?:css|js)$ {
expires 7d;
add_header Cache-Control "public";
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php/php7.0-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_cache_bypass $skip_cache;
fastcgi_no_cache $skip_cache;
fastcgi_cache QWERTY;
fastcgi_cache_valid 60m;
}
location ~ /purge(/.*) {
fastcgi_cache_purge QWERTY "$scheme$request_method$host$1";
}
}