Skip to content

Commit

Permalink
Fix nginx static config
Browse files Browse the repository at this point in the history
  • Loading branch information
manti-by committed Feb 22, 2024
1 parent 2ec7703 commit 58baca6
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 deletions.
16 changes: 14 additions & 2 deletions config/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ server {
include /home/manti/www/semkov/config/proxy-params.conf;
}

location /(static|media)/ {
root /mnt/nostromo/www/semkov/;
location /static/ {
alias /mnt/nostromo/www/semkov/static/;

if ($request_filename ~ "^.*/(.+\.(jpe?g|png|gif|svg|webp|json|js|css|eot|ttf|woff|woff2|ico|pdf))$") {
expires max;
Expand All @@ -63,6 +63,18 @@ server {
}
}

location /media/ {
alias /mnt/nostromo/www/semkov/media/;

if ($request_filename ~ "^.*/(.+\.(jpe?g|png|gif|svg|webp|pdf))$") {
expires max;
access_log off;

add_header Pragma 'public';
add_header Cache-Control 'public, must-revalidate, proxy-revalidate';
}
}

location / {
expires 7d;
add_header Pragma 'public';
Expand Down
4 changes: 2 additions & 2 deletions semkov/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@
<meta property="og:image" content="{% static 'img/semkov-gorodok.jpg' %}">
{% endblock %}

<link rel="manifest" href="{% static "manifest.json" %}">
<link rel="manifest" href="/manifest.json">

<link rel="icon" type="image/x-icon" href="{% static "favicon.ico" %}">
<link rel="icon" type="image/x-icon" href="/favicon.ico">
<link rel="icon" type="image/png" sizes="18x18" href="{% static "img/appicon/18x18.png" %}">
<link rel="icon" type="image/png" sizes="24x24" href="{% static "img/appicon/24x24.png" %}">
<link rel="icon" type="image/png" sizes="36x36" href="{% static "img/appicon/36x36.png" %}">
Expand Down

0 comments on commit 58baca6

Please sign in to comment.