I have an NGINX config issue where I'm trying to move the port from 80 to 8080. Bearing in mind I have iptables turned off and nothing is being written to the log files, when I switch the ports from 80 to 8080 I cannot connect. Here is a sample of my config:
Code:
server {
# Configure the domain that will run WordPress
server_name xxxxxxx.xxxxxxx;
#listen 8080;
listen 80;
port_in_redirect off;
server_tokens off;
autoindex off;
error_log /var/log/nginx/xxxxxxx.error_log;
client_max_body_size 15m;
client_body_buffer_size 128k;
root /home/websites/xxxxxx_me/public;
index index.html index.htm index.php;
#try_files $uri $uri/ /index.php?q=$uri&$args;
try_files $uri $uri/ /index.php;
# Define default caching of 24h
expires 86400s;
add_header Pragma public;
add_header Cache-Control "max-age=86400, public, must-revalidate, proxy-revalidate";
# deliver a static 404
error_page 404 /404.html;
location /404.html {
internal;
}
# Deliver 404 instead of 403 "Forbidden"
error_page 403 = 404;
# Do not allow access to files giving away your WordPress version
location ~ /(\.|wp-config.php|readme.html|licence.txt) {
return 404;
}
# Add trailing slash to */wp-admin requests.
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
# Don't log robots.txt requests
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# Rewrite for versioned CSS+JS via filemtime
location ~* ^.+\.(css|js)$ {
rewrite ^(.+)\.(\d+)\.(css|js)$ $1.$3 last;
expires 31536000s;
access_log off;
log_not_found off;
add_header Pragma public;
add_header Cache-Control "max-age=31536000, public";
}
# Aggressive caching for static files
# If you alter static files often, please use
# add_header Cache-Control "max-age=31536000, public, must-revalidate, proxy-revalidate";
location ~* \.(asf|asx|wax|wmv|wmx|avi|bmp|class|divx|doc|docx|eot|exe|gif|gz|gzip|ico|jpg|jpeg|jpe|mdb|mid|midi|mov|qt|mp3|m4a|mp4|m4v|mpeg|mpg|mpe|mpp|odb|odc|odf|odg|odp|ods|odt|ogg|ogv|otf|pdf|png|pot|pps|ppt|pptx|ra|ram|svg|svgz|swf|tar|t?gz|tif|tiff|ttf|wav|webm|wma|woff|wri|xla|xls|xlsx|xlt|xlw|zip)$ {expires 31536000s;
access_log off;
log_not_found off;
add_header Pragma public;
add_header Cache-Control "max-age=31536000, public";
}
# pass PHP scripts to Fastcgi listening on Unix socket
# Do not process them if inside WP uploads directory
# If using Multisite or a custom uploads directory,
# please set the */uploads/* directory in the regex below
location ~* (^(?!(?:(?!(php|inc)).)*/uploads/).*?(php)) {
try_files $uri = 404;
fastcgi_split_path_info ^(.+.php)(.*)$;
fastcgi_pass unix:/var/run/php-fpm/xxxxxx.socket;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
fastcgi_intercept_errors on;
fastcgi_ignore_client_abort off;
fastcgi_connect_timeout 60;
fastcgi_send_timeout 180;
fastcgi_read_timeout 180;
fastcgi_buffer_size 128k;
fastcgi_buffers 4 256k;}
# Deny access to hidden files
location ~ /\. {
deny all;
access_log off;
log_not_found off;
}
}
# Redirect all www. queries to non-www
# Change in case your site is to be available at "www.yourdomain.tld"
server {
#listen 8080;
listen 80;
server_name www.xxxxxxx.xxxxxxx;
rewrite ^ $scheme://xxxxxxx.xxxxxxx$request_uri? permanent;
}
Keep in mind it works great under port 80, just not 8080. I'm really thrown for a loop here. Thanks in advance.