What is your nginx config look like?
I do the opposite of you, I have two sites on my Forge server for MyApp
myapp.com and www.myapp.com
myapp.com always redirects to www.myapp.com, as I've intended.
# myapp.com
server {
# listen 80;
server_name myapp.com;
return 301 $scheme://www.myapp.com$request_uri;
# FORGE SSL (DO NOT REMOVE!)
# ssl on;
# ssl_certificate;
# ssl_certificate_key;
}
and then this (which I think is pretty much the default):
# www.myapp.com
server {
listen 80;
server_name www.myapp.com;
root /home/forge/www.myapp.com/public;
# FORGE SSL (DO NOT REMOVE!)
# ssl on;
# ssl_certificate;
# ssl_certificate_key;
index index.html index.htm index.php;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
location = /favicon.ico { access_log off; log_not_found off; }
location = /robots.txt { access_log off; log_not_found off; }
access_log off;
error_log /var/log/nginx/www.myapp.com-error.log error;
error_page 404 /index.php;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
location ~ /\.ht {
deny all;
}
}
