Skip to content

How to configure a static / public file serving project in Coolify? #5073

Discussion options

You must be logged in to vote
  1. Go to "New Persistent Storage"
  2. Add a "File Mount"
    • Destination Path: /etc/nginx/conf.d/cors.conf
    • Content:
      map $http_origin $cors_origin {
        default "";
        "~^https?://(.*\.)?example\.(com|org)$" $http_origin;
      }
      
      server {
        root /usr/share/nginx/html/;
      
        location ~* \.(eot|otf|ttf|woff|woff2)$ {
          proxy_http_version 1.1;
          proxy_set_header Upgrade $http_upgrade;
          proxy_set_header Connection 'upgrade';
          proxy_set_header Host $host;
          proxy_cache_bypass $http_upgrade;
      
          add_header Access-Control-Allow-Origin $cors_origin;
          add_header Strict-Transport-Security "max-age=100; includeSubDomains" always;
          add_header Vary "Origin";
      
          try_files $uri $uri/ =404;
        }
        
        loc…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by TessavWalstijn
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant