File discourse.fix-nginx-config.patch of Package discourse

Index: discourse/config/nginx.sample.conf
===================================================================
--- discourse.orig/config/nginx.sample.conf
+++ discourse/config/nginx.sample.conf
@@ -3,15 +3,15 @@ types {
     text/csv csv;
 }
 
-upstream discourse {
-  server unix:/var/www/discourse/tmp/sockets/nginx.http.sock;
-  server unix:/var/www/discourse/tmp/sockets/nginx.https.sock;
-}
+# upstream discourse {
+#   server unix:/var/www/discourse/tmp/sockets/nginx.http.sock;
+#   server unix:/var/www/discourse/tmp/sockets/nginx.https.sock;
+# }
 
 # inactive means we keep stuff around for 1440m minutes regardless of last access (1 week)
 # levels means it is a 2 deep heirarchy cause we can have lots of files
 # max_size limits the size of the cache
-proxy_cache_path /var/nginx/cache inactive=1440m levels=1:2 keys_zone=one:10m max_size=600m;
+proxy_cache_path /var/lib/nginx/cache/ inactive=1440m levels=1:2 keys_zone=one:10m max_size=600m;
 
 # see: https://meta.discourse.org/t/x/74060
 proxy_buffer_size 8k;
@@ -21,6 +21,9 @@ proxy_buffer_size 8k;
 # upstream discourse {
 #   server unix:/var/www/discourse/tmp/sockets/puma.sock;
 # }
+upstream discourse {
+  server unix:/srv/www/vhosts/discourse/tmp/sockets/puma.sock;
+}
 
 
 # attempt to preserve the proto, must be in http context
@@ -33,7 +36,7 @@ log_format log_discourse '[$time_local]
 
 server {
 
-  access_log /var/log/nginx/access.log log_discourse;
+  access_log /var/log/nginx/discourse.access.log log_discourse;
 
   listen 80;
   gzip on;
@@ -66,7 +69,7 @@ server {
   client_max_body_size 10m;
 
   # path to discourse's public directory
-  set $public /var/www/discourse/public;
+  set $public /srv/www/vhosts/discourse/public; # $public
 
   # without weak etags we get zero benefit from etags on dynamically compressed content
   # further more etags are based on the file in nginx not sha of data
@@ -261,6 +264,7 @@ server {
   }
 
   location @discourse {
+    root $public;
     proxy_set_header Host $http_host;
     proxy_set_header X-Request-Start "t=${msec}";
     proxy_set_header X-Real-IP $remote_addr;
openSUSE Build Service is sponsored by