Nginx fails to load text/css (Run under docker) - docker

I have a Nginx that runs behind docker.
Here's my .conf file
events {
worker_connections 2048;
}
http {
default_type application/octet-stream;
server {
listen 80;
index index.php index.html;
root /var/www/public;
location / {
try_files $uri /index.php?$args;
}
location ~ \.css {
include /etc/nginx/mime.types;
add_header Content-Type text/css;
}
location ~ \.js {
add_header Content-Type application/x-javascript;
}
location ~ ^/(assets/|css/|js/|index.html) {
root /var/www/public;
index index.html;
access_log off;
}
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass app:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
}
I've followed the solution here:
Nginx fails to load css files
I also have tried the following:
Put include /etc/nginx/mime.types; under http {
I've checked mime.types that it has the correct value as follows:
text/css css;
The result that i am getting from Chrome dev console is this:
Accept-Ranges: bytes
Content-Length: 52806
Content-Type: text/plain
Content-Type: text/css
Date: Thu, 20 Sep 2018 09:49:35 GMT
ETag: "5ba0bfef-ce46"
For some reason, Nginx loads it as text/plain and text/css altogether.
This is the Nginx version that I am using:
Server: nginx/1.15.3
EDIT
Interestingly enough, if i do curl -v like this, it is being treated as text/css
Can anyone point me in the right direction? Thanks

Related

404 errors when sites-enabled/localhost but not when overriding the default /etc/nginx/nginx.conf

I've got a docker container that's acting as a reverse proxy for local kubernetes services - I know, I should be using real ingress controllers, but at the moment I'm working with others who are using this configuration and I'm trying to troubleshoot it.
When I have no /etc/nginx/sites-enabled files, and /etc/nginx/nginx.conf is configured like this:
worker_processes 1;
events {
worker_connections 1024;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 10;
types_hash_max_size 2048;
add_header Referrer-Policy no-referrer-when-downgrade;
add_header X-Content-Type-Options nosniff;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
add_header X-XSS-Protection "1; mode=block";
server_tokens off;
server_names_hash_bucket_size 128;
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format artformat '$remote_addr,$remote_user,$time_local,"$request",$status,$body_bytes_sent,"$http_referer","$http_user_agent",$request_time';
access_log /var/log/nginx/access.log artformat;
error_log /var/log/nginx/error.log debug;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types application/javascript text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
include /etc/nginx/sites-enabled/*;
server {
listen 80 default_server;
server_name localhost;
root /usr/share/nginx/html;
charset utf-8;
index index.html;
try_files $uri $uri/ =404;
# Resolve app first.
location /app/ {
resolver 10.96.0.10 valid=30s;
set $skill_matrix_app skill-matrix-app.default.svc.cluster.local;
set $skill_matrix_app_port 8080;
proxy_pass http://$skill_matrix_app:$skill_matrix_app_port;
add_header Cache-Control "max-age=0 ,no-cache, no-store, must-revalidate";
}
# Resolve the angular static files second.
location ~* /app/.*\.(js|css|gz|png|svg|jpg|gif|woff|woff2|ttf|otf|eot|json|map|txt)$ {
resolver 10.96.0.10 valid=30s;
set $skill_matrix_app skill-matrix-app.default.svc.cluster.local;
set $skill_matrix_app_port 8080;
proxy_pass http://$skill_matrix_app:$skill_matrix_app_port;
add_header Cache-Control "max-age=0 ,no-cache, no-store, must-revalidate";
}
# API resolution after the app resolution
location /api/ {
resolver 10.96.0.10 valid=30s;
set $skill_matrix_api skill-matrix-api.default.svc.cluster.local;
set $skill_matrix_api_port 8000;
proxy_pass http://$skill_matrix_api:$skill_matrix_api_port;
add_header Cache-Control "max-age=0 ,no-cache, no-store, must-revalidate";
}
# Admin comes after the app and it's static files.
location /admin/ {
resolver 10.96.0.10 valid=30s;
set $skill_matrix_api skill-matrix-api.default.svc.cluster.local;
set $skill_matrix_api_port 8000;
proxy_pass http://$skill_matrix_api:$skill_matrix_api_port;
add_header Cache-Control "max-age=0 ,no-cache, no-store, must-revalidate";
}
# Add static resolution for django files
location ~* /static/.*\.(js|css|gz|png|svg|jpg|gif|woff|woff2|ttf|otf|eot|json|map|txt)$ {
resolver 10.96.0.10 valid=30s;
set $skill_matrix_api skill-matrix-api.default.svc.cluster.local;
set $skill_matrix_api_port 8000;
proxy_pass http://$skill_matrix_api:$skill_matrix_api_port;
}
}
}
Things work great - I can get the app:
When I move the server config into /etc/nginx/sites-enabled/localhost like this:
server {
listen 80 default_server;
server_name localhost;
root /usr/share/nginx/html;
charset utf-8;
index index.html;
try_files $uri $uri/ =404;
# Resolve app first.
location /app/ {
resolver 10.96.0.10 valid=30s;
set $skill_matrix_app skill-matrix-app.default.svc.cluster.local;
set $skill_matrix_app_port 8080;
proxy_pass http://$skill_matrix_app:$skill_matrix_app_port;
add_header Cache-Control "max-age=0 ,no-cache, no-store, must-revalidate";
}
# Resolve the angular static files second.
location ~* /app/.*\.(js|css|gz|png|svg|jpg|gif|woff|woff2|ttf|otf|eot|json|map|txt)$ {
resolver 10.96.0.10 valid=30s;
set $skill_matrix_app skill-matrix-app.default.svc.cluster.local;
set $skill_matrix_app_port 8080;
proxy_pass http://$skill_matrix_app:$skill_matrix_app_port;
add_header Cache-Control "max-age=0 ,no-cache, no-store, must-revalidate";
}
# API resolution after the app resolution
location /api/ {
resolver 10.96.0.10 valid=30s;
set $skill_matrix_api skill-matrix-api.default.svc.cluster.local;
set $skill_matrix_api_port 8000;
proxy_pass http://$skill_matrix_api:$skill_matrix_api_port;
add_header Cache-Control "max-age=0 ,no-cache, no-store, must-revalidate";
}
# Admin comes after the app and it's static files.
location /admin/ {
resolver 10.96.0.10 valid=30s;
set $skill_matrix_api skill-matrix-api.default.svc.cluster.local;
set $skill_matrix_api_port 8000;
proxy_pass http://$skill_matrix_api:$skill_matrix_api_port;
add_header Cache-Control "max-age=0 ,no-cache, no-store, must-revalidate";
}
# Add static resolution for django files
location ~* /static/.*\.(js|css|gz|png|svg|jpg|gif|woff|woff2|ttf|otf|eot|json|map|txt)$ {
resolver 10.96.0.10 valid=30s;
set $skill_matrix_api skill-matrix-api.default.svc.cluster.local;
set $skill_matrix_api_port 8000;
proxy_pass http://$skill_matrix_api:$skill_matrix_api_port;
}
}
and remove that server configuration from the /etc/nginx/nginx.conf file:
worker_processes 1;
events {
worker_connections 1024;
}
http {
sendfile on;
tcp_nopush on;
tcp_nodelay on;
keepalive_timeout 10;
types_hash_max_size 2048;
add_header Referrer-Policy no-referrer-when-downgrade;
add_header X-Content-Type-Options nosniff;
add_header X-Download-Options noopen;
add_header X-Permitted-Cross-Domain-Policies none;
add_header X-XSS-Protection "1; mode=block";
server_tokens off;
server_names_hash_bucket_size 128;
include /etc/nginx/mime.types;
default_type application/octet-stream;
log_format artformat '$remote_addr,$remote_user,$time_local,"$request",$status,$body_bytes_sent,"$http_referer","$http_user_agent",$request_time';
access_log /var/log/nginx/access.log artformat;
error_log /var/log/nginx/error.log debug;
gzip on;
gzip_disable "msie6";
gzip_vary on;
gzip_proxied any;
gzip_comp_level 6;
gzip_buffers 16 8k;
gzip_http_version 1.1;
gzip_types application/javascript text/plain text/css application/json application/x-javascript text/xml application/xml application/xml+rss text/javascript;
include /etc/nginx/sites-enabled/*;
}
I start getting 404 not found and it looks like it's trying to find these files in the html root instead of proxying them:
2022/06/28 22:47:46 [error] 32#32: *1 "/usr/share/nginx/html/app/index.html" is not found (2: No such file or directory), client: 127.0.0.1, server: localhost, request: "GET /app/ HTTP/1.1", host: "localhost"
127.0.0.1 - - [28/Jun/2022:22:47:46 +0000] "GET /app/ HTTP/1.1" 404 555 "-" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/103.0.0.0 Safari/537.36" "-"
Why is it trying to find app/index.html instead of proxying to the service?
Solved this by adding a removal line to the dockerfile to remove the default.conf based on https://www.nginx.com/blog/deploying-nginx-nginx-plus-docker/:
FROM nginx:1.21
RUN rm /etc/nginx/nginx.conf /etc/nginx/conf.d/default.conf
RUN mkdir /etc/nginx/sites-enabled/
COPY error/ /var/www/html
COPY index.html /var/www/html
COPY favicon.ico /var/www/html
COPY localhost.crt /opt/nginx/ssl_keys/ssl.crt
COPY localhost.key /opt/nginx/ssl_keys/ssl.key
COPY sites-enabled/ /etc/nginx/sites-enabled/
COPY nginx.conf /etc/nginx
Once I did that, the default.conf was no longer overriding and trying to get everything to look at the local host.

Rewriting all URLs to a single PHP controller on nginx

I've a web server which has two PHP files, index.php and controller.php, the latter which handles all non-/ requests with a p (for page) parameter, e.g.
/controller.php?p=some_page
The following nginx configuration works nicely:
server {
listen 80;
index index.php index.html;
server_name localhost;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /code;
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
}
However, I now want to clean up the URLs, and want / to go to index.php and /some_page to go to /controller.php?p=some_page.
Here's the new configuration I'm trying:
server {
listen 80;
index index.php index.html;
server_name localhost;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /code;
# this is new, and makes index.php handle /
location / {
index index.php;
try_files $uri $uri/ =404;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
# this is new, but doesn't work.
location #rewrites {
if ($uri ~* ^/([0-9a-z_]+)$) {
set $page_to_view "/controller.php?p=$1";
rewrite ^/([0-9a-z_]+)$ $scheme://$http_host/controller.php?p=$1 last;
}
}
}
The browser address bar shows this:
- http://localhost:8080/some_page (initial request)
- http://localhost:8080/controller.php?p=some_page (first redirect one second later)
- https://localhost/some_page/ (final redirect another second later)
So, it ends up on a URL which doesn't have the original port, with a trailing slash, and using scheme https.
What can I do to fix it?
PS It would be a bonus if trailing slashes didn't matter (i.e. localhost:8080/some_page and localhost:8080/some_page/ shows the same thing.
PS the port 8080 is just me locally testing via Docker, which maps container 80 to host 8080.
Update:
I've implemented Richard's answers, and tried the suggested curl:
$ curl -I http://localhost:8080/some_page
HTTP/1.1 301 Moved Permanently
Server: nginx/1.21.4
Date: Thu, 09 Dec 2021 15:07:11 GMT
Content-Type: text/html
Content-Length: 169
Location: http://localhost/some_page/
Connection: keep-alive
Note the lack of port 8080.
Update 2:
With nginx directive absolute_redirect off;, I get this:
$ curl -I http://localhost:8080/some_page
HTTP/1.1 301 Moved Permanently
Server: nginx/1.21.4
Date: Thu, 09 Dec 2021 16:01:31 GMT
Content-Type: text/html
Content-Length: 169
Connection: keep-alive
Location: /some_page/
$ curl -I http://localhost:8080/some_page/
HTTP/1.1 404 Not Found
Server: nginx/1.21.4
Date: Thu, 09 Dec 2021 16:01:34 GMT
Content-Type: text/html
Content-Length: 153
Connection: keep-alive
So, the question remains how a request to /some_page/ can serve up the response from /controller.php?p=some_page
A named location (e.g. location #rewrites) is usually invoked from the last element of a try_files statement.
For example:
location / {
index index.php;
try_files $uri $uri/ #rewrites;
}
In your location #rewrites block, the if statement is unnecessary, the set variable is unused, and the rewrite statement will provoke an external redirect.
Try:
location #rewrites {
rewrite ^/([0-9a-z_]+)$ /controller.php?p=$1 last;
}
I've landed on a configuration which works with the original links, but also the pretty URLs I was aiming for.
server {
listen 80;
index index.php;
server_name localhost;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
root /code;
location = / {
index index.php;
try_files $uri $uri/ =404;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass php:9000;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location ~* {
rewrite ^/([0-9a-z_]+)/?$ /controller.php?p=$1 last;
}
}
The key seems to be to not use a named location for the rewrite, but just match "everything else" with location ~* if the request isn't for / or a PHP file.

cors issue when making request from reactjs locally into lumen backend with docker nginx

I am having trouble with CORS when testing my API endpoint through reactjs.
I get this error in the google chrome logs
Access to XMLHttpRequest at 'http://localhost/v1/testendpoint' from origin 'http://localhost:3000' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.
Also, the CORS are setup in the laravel middleware.
{
$headers = [
'Access-Control-Allow-Origin' => '*',
'Access-Control-Allow-Methods' => 'POST, GET, PUT, DELETE, OPTIONS',
'Access-Control-Allow-Headers' => 'Content-Type, Authorization, Accept, X-Requested-With'
];
if ($request->isMethod('OPTIONS'))
{
return response()->json('{"method":"OPTIONS"}', 200, $headers);
}
$response = $next($request);
foreach($headers as $key => $value)
{
$response->header($key, $value);
}
return $response;
}
The nginx setup inside docker is as follows.
listen 80; ## listen for ipv4; this line is default and implied
listen [::]:80 default ipv6only=on; ## listen for ipv6
#root /usr/share/nginx/html;
root /var/www/html/public;
index index.php index.html index.htm;
# Make site accessible from http://localhost/
server_name _;
# Disable sendfile as per https://docs.vagrantup.com/v2/synced-folders/virtualbox.html
sendfile off;
# Security - Hide nginx version number in error pages and Server header
server_tokens off;
# Add stdout logging
error_log /dev/stdout info;
access_log /dev/stdout;
# reduce the data that needs to be sent over network
gzip on;
gzip_min_length 10240;
gzip_proxied expired no-cache no-store private auth;
gzip_types text/plain text/css text/xml application/json text/javascript application/x-javascript application/xml;
gzip_disable "MSIE [1-6]\.";
location / {
# First attempt to serve request as file, then
# as directory, then fall back to index.html
try_files $uri $uri/ /index.php?$query_string;
add_header 'Access-Control-Allow-Origin: *');
add_header 'Access-Control-Allow-Origin: GET, POST, DELETE, PUT, PATCH, OPTIONS');
add_header 'Access-Control-Allow-Credentials: true');
}
# 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 the PHP scripts to FastCGI server listening on socket
#
location ~ \.php$ {
try_files $uri /index.php =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.2-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param PATH_INFO $fastcgi_path_info;
}
location ~* \.(jpg|jpeg|gif|png|css|js|ico|xml)$ {
expires 5d;
}
# deny access to . files, for security
#
location ~ /\. {
log_not_found off;
deny all;
}
}
Does anyone have an idea on why this is happening.
I found a way round this, by using a plugin in google chrome to bypass this with Google allow CORS plugin.

Nginx Proxy Pass Always Returning 404s

So I'm working on a POC for a micro-frontend architecture. I am using nginx as the driver for this. In my local environment, I'm testing the docker configuration for the projects. Each micro-frontend will be in its own docker container, and they will share a network. The container names are:
micro-fe-parent
micro-fe-react-wc
The goal is to get micro-fe-parent to be able to load content from micro-fe-react-wc via an nginx proxy. My webpack dev server proxy setup works perfectly with my existing code, but with nginx all I'm getting is 404s.
I can shell into the container and use curl to hit the micro-fe-react-wc application directly, and I can manually request any file successfully this way. So the containers can see each other, the docker network is working. Something in the proxy pass is not working. Unfortunately, nginx logs are no help, and it's debugging tools are really lacking.
The goal of the proxy is that any URI it sees that starts with /react-wc, it will remove the /react-wc part and resolve the rest of the URI against the target host. So let's say I have a file called "app.js", the request I would be making from micro-fe-parent would be /react-wc/assets/app.js, and nginx would proxy that to http://micro-fe-react-wc/assets/app.js, preserving most of the URI but removing that one path element.
I've tried everything I can think of to configure this properly.
Here is my nginx.conf:
worker_processes auto;
events {
worker_connections 1024;
multi_accept on;
}
http {
log_format compression '$remote_addr - $remote_user [$time_local] '
'"$request" $status $upstream_addr '
'"$http_referer" "$http_user_agent"';
log_format new_format '[$time_local] $remote_addr - $remote_user - $server_name to: $upstream_addr: $request upstream_response_time $upstream_response_time msec $msec request_time $request_time';
include /etc/nginx/mime.types;
default_type text/plain;
gzip on;
gzip_disable "msie6"
gzip_comp_level 6;
gzip_min_length 1100;
gzip_buffers 16 8k;
gzip_proxied any;
gunzip on;
gzip_static always;
gzip_types text/plain text/css text/js text/xml text/javascript application/javascript application/x-javascript application/json application/xml application/xml+rss;
gzip_vary on;
fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
proxy_buffer_size 128k;
proxy_buffers 4 256k;
proxy_busy_buffers_size 256k;
server {
listen 80;
server_name micro-fe-parent;
access_log /var/log/nginx/access.log new_format;
error_log /var/log/nginx/error.log debug;
rewrite_log on;
root /var/www;
index index.html;
location / {
try_files $uri $uri/ /index.html;
}
location /react-wc {
rewrite '^/react-wc(/.*)$' '$1' break;
proxy_pass http://micro-fe-react-wc;
}
location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc)$ {
expires 1M;
access_log off;
add_header Cache-Control "public";
}
location ~* \.(?:css|js)$ {
try_files $uri =404;
expires 1y;
access_log off;
add_header Cache-Control "public";
}
location ~ ^.+\..+$ {
try_files $uri =404;
}
}
}
So the problem was I wasn't using ^~ to treat it like a regex match, so it was looking for a literal /react-wc path instead of as a matcher on the path.
location ^~ /react-wc {
rewrite '^/react-wc(/.*)$' '$1' break;
proxy_pass http://micro-fe-react-wc;
}

Phusion Passenger + (Rails + Drupal) = unable to deliver Drupal app

I'm having trouble getting Phusion Passenger to serve a Rails app as well as a Drupal app, which live on the same server.
The Rails app lives in ~/Kiji and the Drupal app lives in ~/asia-gazette, as shown in the config below.
When I try running curl kiji.dev I get the Rails app, which is correct. When I try running curl eag.dev (the Drupal app) from the server I am getting a 200 response with nothing else. No output, nothing in the nginx error.log file.
Below is what my nginx.conf file looks like at the moment (note that I set the user for nginx as www-data so that it can be used by php5-fpm)
user www-data;
worker_processes 1;
error_log logs/error.log;
events {
worker_connections 1024;
}
http {
passenger_root /home/dani/.rvm/gems/ruby-2.1.2/gems/passenger-4.0.48;
passenger_ruby /home/dani/.rvm/gems/ruby-2.1.2/wrappers/ruby;
include mime.types;
default_type application/octet-stream;
sendfile on;
keepalive_timeout 65;
server {
listen 80;
server_name kiji.dev;
passenger_enabled on;
root /home/dani/Kiji/public;
location ~ ^/(assets)/ {
expires max;
add_header Cache-Control public;
gzip_static on;
}
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root html;
}
}
server {
listen 80;
root /home/dani/asia-gazette;
server_name eag.dev;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
log_not_found off;
access_log off;
}
# This is needed for Drush
location = /backup {
deny all;
}
# Very rarely should these ever be accessed outside of the LAN
location ~* \.(txt|log)$ {
allow 127.0.0.1;
deny all;
}
location / {
try_files $uri $uri/ =404;
index index.php;
}
error_page 404 /404.html;
error_page 500 502 503 504 /50x.html;
location = /50x.html {
root /home/dani/asia-gazette;
}
location ~ \.php$ {
try_files $uri =404;
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php5-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
}
}
}
And my hosts file:
127.0.0.1 kiji.dev eag.dev
In my /etc/php5/fpm/pool.d/www.conf file, I have the following:
listen.owner = www-data
listen.group = www-data
;listen.mode = 0660
I've tried un-commenting the listen.mode and re-commenting but the result is the same. I restart nginx and php5-fpm and:
$ curl -v eag.dev
* Rebuilt URL to: eag.dev/
* Hostname was NOT found in DNS cache
* Trying xxx.xxx.xxx.xxx...
* Connected to eag.dev (xxx.xxx.xxx.xxx) port 80 (#0)
> GET / HTTP/1.1
> User-Agent: curl/7.35.0
> Host: eag.dev
> Accept: */*
>
< HTTP/1.1 200 OK
* Server nginx/1.6.0 is not blacklisted
< Server: nginx/1.6.0
< Date: Mon, 28 Jul 2014 15:57:06 GMT
< Content-Type: text/html
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Powered-By: PHP/5.5.9-1ubuntu4.3
<
* Connection #0 to host eag.dev left intact
I'm really not sure what I'm doing wrong and why Passenger will not show my Drupal app.
Any help would be much appreciated.
Thank you!
After a lot of research and frustration, I think I found the solution. Adding the following to /etc/nginx/conf/fastcgi.conf seems to have done the trick:
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;

Resources