Browse Source

Update Nginx example with CORS and location to index.html

JC Brand 6 years ago
parent
commit
55bb1826ea
1 changed files with 10 additions and 0 deletions
  1. 10 0
      docs/source/setup.rst

+ 10 - 0
docs/source/setup.rst

@@ -180,9 +180,19 @@ Nginx
         server {
             listen       80
             server_name  mysite.com;
+
+            location = / {
+                root    /path/to/converse.js/;  # Properly set the path here
+                index   index.html;
+            }
             location ~ ^/http-bind/ {
                 proxy_pass http://someothersite.com;
             }
+            # CORS
+            location ~ .(ttf|ttc|otf|eot|woff|woff2|font.css|css|js)$ {
+                add_header Access-Control-Allow-Origin "*"; # Decide here whether you want to allow all or only a particular domain
+                root   /path/to/converse.js/;  # Properly set the path here
+            }
         }
     }