So I have NGINX installed from the ports and it works well. I've recently installed WP and want to run multi-site.
The issue is the sub domain stuff. So when I go to
http://domainname...I'm good.
http://sub.domainname.com no access. I've configured NGINX hundreds of times before so I must be missing something. Here is my server blocks
Code:
server {
listen 80;
server_name domain.com *.domain.com;
root /opt/wordpress;
index index.php index.html index.htm;
access_log /var/log/nginx/domain.access_log;
error_log /var/log/nginx/domain.error_log;
# Security
include global/security.conf;
#ModSecurityEnabled on;
#ModSecurityConfig /usr/local/etc/modsecurity/modsecurity.conf;
location / {
# This is cool because no php is touched for static content.
# include the "?$args" part so non-default permalinks doesn't break when using query string
try_files $uri $uri/ /index.php?$args;
}
# PHP-FPM
include global/php-fpm.conf;
# STATICS FILES
location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ {
expires max;
log_not_found off;
}
}
Code:
user www;
# Set this value to 1 or N with N = N-Core
worker_processes 2;
worker_rlimit_nofile 4096;
events {
# max_clients = worker_processes * worker_connections
worker_connections 1024;
# Only for Linux 2.6 or >
use kqueue;
# Accept as many connections as possible
multi_accept on;
}
http {
# Mime types
include mime.types;
default_type application/octet-stream;
# Log format
set_real_ip_from 127.0.0.1;
real_ip_header X-Forwarded-For;
log_format main '$remote_addr - $remote_user [$time_local] $status '
'"$request" $body_bytes_sent "$http_referer" '
'"$http_user_agent" "$http_x_forwarded_for"';
# Hide the Nginx version number
server_tokens off;
# Some tweeks...
sendfile on;
tcp_nodelay on;
#tcp_nopush on;
# Timeouts
#keepalive_timeout 10 10;
keepalive_timeout 65;
client_body_timeout 30;
client_header_timeout 30;
send_timeout 30;
client_max_body_size 8M;
reset_timedout_connection on;
# Gzip module configuration
gzip on;
gzip_disable "MSIE [1-6].(?!.*SV1)";
gzip_vary on;
gzip_comp_level 3;
gzip_proxied any;
gzip_buffers 16 8k;
include /usr/local/etc/nginx/site-configuration/*;
}
What am I missing that's preventing the subdomains from being reachable. I tend to have domain mapping installed as well but I need to get this working first.