No MIME types

I have just set up a Debian Wheezy nginx web server with PHP-FPM and
while
it shows the hosted websites it doesn’t analyse the MIME types and
without
CSS or JS modern websites are not working.
The problem is the second domain.tld entry:

error.log:

2013/06/22 09:10:46 [error] 7806#0: *1 open()
“/var/www/domain.tld/htdocs/domain.tld/wordpress/wp-content/themes/twentytwelve/style.css”
failed (2: No such file or directory), client: 5.6.7.8, server:
localhost,
request: “GET
/domain.tld/wordpress/wp-content/themes/twentytwelve/style.css?ver=3.5.1
HTTP/1.1”, host: “1.2.3.4”, referrer: “http://1.2.3.4/wordpress/
2013/06/22 09:10:46 [error] 7806#0: *1 open()
“/var/www/domain.tld/htdocs/domain.tld/wordpress/wp-content/themes/twentytwelve/js/navigation.js”
failed (2: No such file or directory), client: 5.6.7.8, server:
localhost,
request: “GET
/domain.tld/wordpress/wp-content/themes/twentytwelve/js/navigation.js?ver=1.0
HTTP/1.1”, host: “1.2.3.4”, referrer: “http://1.2.3.4/wordpress/

How can I fix this?
Thanks

nginx.conf:

user nginx;
worker_processes 4;

error_log /var/log/nginx/error.log warn;
pid /var/run/nginx.pid;

events {
worker_connections 1024;
}

http {
include /etc/nginx/mime.types;
default_type application/octet-stream;

log_format  main  '$remote_addr - $remote_user [$time_local] 

“$request”

'$status $body_bytes_sent “$http_referer” ’
‘"$http_user_agent" “$http_x_forwarded_for”’;

access_log  /var/log/nginx/access.log  main;

sendfile        on;
#tcp_nopush     on;

keepalive_timeout  65;

gzip  on;

include /etc/nginx/conf.d/*.conf;

}

default.conf

server {
listen 80;
server_name localhost;
root /var/www/domain.tld/htdocs;

#charset koi8-r;
#access_log  /var/log/nginx/log/host.access.log  main;

location / {
    index  index.php index.html index.htm;
}

#error_page  404              /404.html;

# redirect server error pages to the static page /50x.html
#
error_page   500 502 503 504  /50x.html;
location = /50x.html {
    root   /usr/share/nginx/html;
}

##
# Pass PHP-Files To Socket
##

location ~ \.php$ {
    try_files $uri =404;
    fastcgi_pass unix:/var/run/php5-fpm.sock;
    fastcgi_index index.php;
    fastcgi_intercept_errors off;
    fastcgi_param SCRIPT_FILENAME 

$document_root$fastcgi_script_name;
include /etc/nginx/fastcgi_params;
}
}

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,240262,240262#msg-240262

On Sat, Jun 22, 2013 at 03:15:30AM -0400, Peleke wrote:

Hi there,

I’m not sure how your question matches the Subject: line you used.

But anyway…

The problem is the second domain.tld entry:

2013/06/22 09:10:46 [error] 7806#0: *1 open()

“/var/www/domain.tld/htdocs/domain.tld/wordpress/wp-content/themes/twentytwelve/style.css”

failed (2: No such file or directory), client: 5.6.7.8, server: localhost,
request: “GET
/domain.tld/wordpress/wp-content/themes/twentytwelve/style.css?ver=3.5.1
HTTP/1.1”, host: “1.2.3.4”, referrer: “http://1.2.3.4/wordpress/

How can I fix this?

I suspect that the answer is going to be “fix your wordpress”.

Does the file

/var/www/domain.tld/htdocs/wordpress/wp-content/themes/twentytwelve/style.css

exist (without the second “/domain.tld”)?

What is the output of

curl -i http://1.2.3.4/wordpress/

and does it include the string

/domain.tld/wordpress/wp-content/themes/twentytwelve/style.css?ver=3.5.1

anywhere? If so, what puts the “/domain.tld” at the start of it?

My guess is that the file does exist, and that the extra /domain.tld
is added by your wordpress. In which case, find where it your wordpress
config it is added, and don’t add it.

Good luck with it,

f

Francis D. [email protected]

I have the same problem with other software (tested selfoss for example)
even if I want to set it up completely from scratch.
How can I find the root problem and fix it?

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,240262,240274#msg-240274

Sorry, you were right, didn’t see it in Selfoss because of SQLite.
Thanks!

Posted at Nginx Forum:
http://forum.nginx.org/read.php?2,240262,240283#msg-240283