Issue Apache behind Nginx Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern) Come Celebrate our 10 Year Anniversary!nginx redirect issue with upstream configurationsvn using nginx Commit failed: path not foundNginx proxy pass works for https but not httpnginx load balancer rewrite to listen portnginx proxy redirecting request to different proxyNginx subversion commit failureNginx/Apache: set HSTS only if X-Forwarded-Proto is httpsnginx rewrite throw 404 with last and breakCodeIgniter nginx rewrite rules for i8ln URL's
How does the body cool itself in a stillsuit?
Inverse square law not accurate for non-point masses?
What are some likely causes to domain member PC losing contact to domain controller?
Why complex landing gears are used instead of simple, reliable and light weight muscle wire or shape memory alloys?
How to resize main filesystem
What does 丫 mean? 丫是什么意思?
How to achieve cat-like agility?
What does the writing on Poe's helmet say?
What did Turing mean when saying that "machines cannot give rise to surprises" is due to a fallacy?
Find general formula for the terms
First paper to introduce the "principal-agent problem"
Why BitLocker does not use RSA
latest version of QGIS fails to edit attribute table of GeoJSON file
My mentor says to set image to Fine instead of RAW — how is this different from JPG?
Can gravitational waves pass through a black hole?
Did John Wesley plagiarize Matthew Henry...?
New Order #6: Easter Egg
What is the proper term for etching or digging of wall to hide conduit of cables
As a dual citizen, my US passport will expire one day after traveling to the US. Will this work?
How do you write "wild blueberries flavored"?
Statistical analysis applied to methods coming out of Machine Learning
Is it OK to use the testing sample to compare algorithms?
systemd and copy (/bin/cp): no such file or directory
Order between one to one functions and their inverses
Issue Apache behind Nginx
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 23, 2019 at 23:30 UTC (7:30pm US/Eastern)
Come Celebrate our 10 Year Anniversary!nginx redirect issue with upstream configurationsvn using nginx Commit failed: path not foundNginx proxy pass works for https but not httpnginx load balancer rewrite to listen portnginx proxy redirecting request to different proxyNginx subversion commit failureNginx/Apache: set HSTS only if X-Forwarded-Proto is httpsnginx rewrite throw 404 with last and breakCodeIgniter nginx rewrite rules for i8ln URL's
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;
I have nginx proxying to apache as a backend in order for nginx to handle static assets. Unfortunately when I attempt to visit main domain it just displays page not found. I get 404 error for these files.
example.com > page not found
example.com/somepage/ > works but web server isn't loading css and js files.
My Nginx config:
server report
As you can see Apache is listening to 8081 port.
Here is its virtual host
<VirtualHost 127.0.0.1:8081>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /home/wpaper/public_html
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
<Directory /home/wpaper/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
.htaccess for root folder
DirectoryIndex index.php
php_flag session.auto_start off
SecFilterEngine Off
SecFilterScanPOST Off
SSLOptions StdEnvVars
Options +FollowSymLinks
RewriteEngine on
#RewriteBase /magento/
RewriteRule .* - [E=HTTP_AUTHORIZATION:%HTTP:Authorization]
RewriteCond %REQUEST_METHOD ^TRAC[EK]
RewriteRule .* - [L,R=405]
#RewriteCond %REQUEST_URI !^/mobiledirectoryhere/.*$
#RewriteCond %HTTP_USER_AGENT "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
#RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]
RewriteCond %REQUEST_FILENAME !-f
RewriteCond %REQUEST_FILENAME !-d
RewriteCond %REQUEST_FILENAME !-l
RewriteRule .* index.php [L]
AddDefaultCharset Off
#AddDefaultCharset UTF-8
AddType 'text/html; charset=UTF-8' html
ExpiresDefault "access plus 1 year"
ExpiresByType text/html A0
ExpiresByType text/plain A0
Header set X-UA-Compatible "IE=edge"
# `mod_headers` cannot match based on the content-type, however,
# the `X-UA-Compatible` response header should be send only for
# HTML documents and not for the other resources.
<FilesMatch ".(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
Header unset X-UA-Compatible
</FilesMatch>
Any help please because I not very familiar with these.
nginx apache-2.4 ubuntu-18.04
add a comment |
I have nginx proxying to apache as a backend in order for nginx to handle static assets. Unfortunately when I attempt to visit main domain it just displays page not found. I get 404 error for these files.
example.com > page not found
example.com/somepage/ > works but web server isn't loading css and js files.
My Nginx config:
server report
As you can see Apache is listening to 8081 port.
Here is its virtual host
<VirtualHost 127.0.0.1:8081>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /home/wpaper/public_html
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
<Directory /home/wpaper/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
.htaccess for root folder
DirectoryIndex index.php
php_flag session.auto_start off
SecFilterEngine Off
SecFilterScanPOST Off
SSLOptions StdEnvVars
Options +FollowSymLinks
RewriteEngine on
#RewriteBase /magento/
RewriteRule .* - [E=HTTP_AUTHORIZATION:%HTTP:Authorization]
RewriteCond %REQUEST_METHOD ^TRAC[EK]
RewriteRule .* - [L,R=405]
#RewriteCond %REQUEST_URI !^/mobiledirectoryhere/.*$
#RewriteCond %HTTP_USER_AGENT "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
#RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]
RewriteCond %REQUEST_FILENAME !-f
RewriteCond %REQUEST_FILENAME !-d
RewriteCond %REQUEST_FILENAME !-l
RewriteRule .* index.php [L]
AddDefaultCharset Off
#AddDefaultCharset UTF-8
AddType 'text/html; charset=UTF-8' html
ExpiresDefault "access plus 1 year"
ExpiresByType text/html A0
ExpiresByType text/plain A0
Header set X-UA-Compatible "IE=edge"
# `mod_headers` cannot match based on the content-type, however,
# the `X-UA-Compatible` response header should be send only for
# HTML documents and not for the other resources.
<FilesMatch ".(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
Header unset X-UA-Compatible
</FilesMatch>
Any help please because I not very familiar with these.
nginx apache-2.4 ubuntu-18.04
add a comment |
I have nginx proxying to apache as a backend in order for nginx to handle static assets. Unfortunately when I attempt to visit main domain it just displays page not found. I get 404 error for these files.
example.com > page not found
example.com/somepage/ > works but web server isn't loading css and js files.
My Nginx config:
server report
As you can see Apache is listening to 8081 port.
Here is its virtual host
<VirtualHost 127.0.0.1:8081>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /home/wpaper/public_html
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
<Directory /home/wpaper/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
.htaccess for root folder
DirectoryIndex index.php
php_flag session.auto_start off
SecFilterEngine Off
SecFilterScanPOST Off
SSLOptions StdEnvVars
Options +FollowSymLinks
RewriteEngine on
#RewriteBase /magento/
RewriteRule .* - [E=HTTP_AUTHORIZATION:%HTTP:Authorization]
RewriteCond %REQUEST_METHOD ^TRAC[EK]
RewriteRule .* - [L,R=405]
#RewriteCond %REQUEST_URI !^/mobiledirectoryhere/.*$
#RewriteCond %HTTP_USER_AGENT "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
#RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]
RewriteCond %REQUEST_FILENAME !-f
RewriteCond %REQUEST_FILENAME !-d
RewriteCond %REQUEST_FILENAME !-l
RewriteRule .* index.php [L]
AddDefaultCharset Off
#AddDefaultCharset UTF-8
AddType 'text/html; charset=UTF-8' html
ExpiresDefault "access plus 1 year"
ExpiresByType text/html A0
ExpiresByType text/plain A0
Header set X-UA-Compatible "IE=edge"
# `mod_headers` cannot match based on the content-type, however,
# the `X-UA-Compatible` response header should be send only for
# HTML documents and not for the other resources.
<FilesMatch ".(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
Header unset X-UA-Compatible
</FilesMatch>
Any help please because I not very familiar with these.
nginx apache-2.4 ubuntu-18.04
I have nginx proxying to apache as a backend in order for nginx to handle static assets. Unfortunately when I attempt to visit main domain it just displays page not found. I get 404 error for these files.
example.com > page not found
example.com/somepage/ > works but web server isn't loading css and js files.
My Nginx config:
server report
As you can see Apache is listening to 8081 port.
Here is its virtual host
<VirtualHost 127.0.0.1:8081>
ServerName example.com
ServerAlias www.example.com
DocumentRoot /home/wpaper/public_html
ErrorLog $APACHE_LOG_DIR/error.log
CustomLog $APACHE_LOG_DIR/access.log combined
<Directory /home/wpaper/public_html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
.htaccess for root folder
DirectoryIndex index.php
php_flag session.auto_start off
SecFilterEngine Off
SecFilterScanPOST Off
SSLOptions StdEnvVars
Options +FollowSymLinks
RewriteEngine on
#RewriteBase /magento/
RewriteRule .* - [E=HTTP_AUTHORIZATION:%HTTP:Authorization]
RewriteCond %REQUEST_METHOD ^TRAC[EK]
RewriteRule .* - [L,R=405]
#RewriteCond %REQUEST_URI !^/mobiledirectoryhere/.*$
#RewriteCond %HTTP_USER_AGENT "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
#RewriteRule ^(.*)$ /mobiledirectoryhere/ [L,R=302]
RewriteCond %REQUEST_FILENAME !-f
RewriteCond %REQUEST_FILENAME !-d
RewriteCond %REQUEST_FILENAME !-l
RewriteRule .* index.php [L]
AddDefaultCharset Off
#AddDefaultCharset UTF-8
AddType 'text/html; charset=UTF-8' html
ExpiresDefault "access plus 1 year"
ExpiresByType text/html A0
ExpiresByType text/plain A0
Header set X-UA-Compatible "IE=edge"
# `mod_headers` cannot match based on the content-type, however,
# the `X-UA-Compatible` response header should be send only for
# HTML documents and not for the other resources.
<FilesMatch ".(appcache|atom|bbaw|bmp|crx|css|cur|eot|f4[abpv]|flv|geojson|gif|htc|ico|jpe?g|js|json(ld)?|m4[av]|manifest|map|mp4|oex|og[agv]|opus|otf|pdf|png|rdf|rss|safariextz|svgz?|swf|topojson|tt[cf]|txt|vcard|vcf|vtt|webapp|web[mp]|webmanifest|woff2?|xloc|xml|xpi)$">
Header unset X-UA-Compatible
</FilesMatch>
Any help please because I not very familiar with these.
nginx apache-2.4 ubuntu-18.04
nginx apache-2.4 ubuntu-18.04
edited Apr 15 at 17:28
G. G.
asked Apr 15 at 17:23
G. G.G. G.
84
84
add a comment |
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "2"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f963160%2fissue-apache-behind-nginx%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Server Fault!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fserverfault.com%2fquestions%2f963160%2fissue-apache-behind-nginx%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown