T
T
Twelfth Doctor2017-01-23 18:01:40
Nginx
Twelfth Doctor, 2017-01-23 18:01:40

Why css files stopped loading after setting up Nginx?

Hello! Such a question: I have a server with Ubuntu Server 16.04, initially I used Apache 2.4 as a web server. I
moved Apache to port 8080, on the 80th port of Nginx as a proxy. For some reason, the CSS files stopped loading.
Nginx config:

server {
listen 80;
server_name *** www.***;

location / {
proxy_pass http://127.0.0.1:8080;
}

location ~* \.(html|jpeg|jpg|gif|png|css|js|pdf|txt|tar|ico)$ {
root /home/***;
expires 60d;
}
}

Apache config:
<VirtualHost *:8080>
AssignUserID *** ***
DirectoryIndex index.php
ServerAdmin [email protected]
DocumentRoot /home/***/panel
ErrorLog /home/***/logs/error.log
CustomLog /home/***/logs/access.log combined
ServerName ***
<Directory "/home/***">
   Require all granted
</Directory>
</VirtualHost>

Apache runs in MPM-ITK mode.
What does the site look like with Nginx proxying:
7c6784c8031040c2b949b78a3f7489bb.jpg
What does the site look like if you access Apache directly (specify port 8080 in the path to the site):
What could be the reason?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question