Project

General

Profile

Redmine 2.5.2 theme not loading / nginx / unicorn

Added by Plam Sim over 9 years ago

Hello,

I have a new installation of Redmine 2.5.2. It works fine but the theme is not loading. No errors in the unicorn and nginx logs. All permissions should be set properly. The attached shows what I see on the browser. Can you please help what should I check?

My configuration:
  • CentOS 6.5
  • Unicorn
  • Nginx (yum installed, no debug option)

My processes
#ps -ef|grep redmine
root unicorn master -D -c /usr/local/share/redmine/config/unicorn.rb -E production
root unicorn worker -D -c /usr/local/share/redmine/config/unicorn.rb -E production

#ps -ef |grep nginx
root nginx: master process /usr/sbin/nginx -c /etc/nginx/nginx.conf
nginx nginx: worker process

My nginx.conf file

http {

  #Added additionally
  include       mime.types;
  default_type  application/octet-stream;
  types_hash_bucket_size 64;
  server_names_hash_bucket_size 128;

 upstream unicorn {
  server unix:/tmp/unicorn.redmine.sock fail_timeout=0;
 }

 server {
  listen 80 default_server deferred;
  # server_name example.com;
  root /usr/local/share/redmine/public;
  access_log /var/log/nginx-access.log;
  error_log /var/log/nginx-error.log;

  location ^~ /assets/ {
    gzip_static on;
    expires max;
    add_header Cache-Control public;
  }

  try_files $uri/index.html $uri @unicorn;
  location @unicorn {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://unicorn;
 }

  error_page 500 502 503 504 /500.html;
  client_max_body_size 40M;
  keepalive_timeout 10;
 }

 }

 events { 
  worker_connections 1024; 
}

Replies (3)

RE: Redmine 2.5.2 theme not loading / nginx / unicorn - Added by Pavel Potcheptsov over 9 years ago

Try to simplify config and see how it goes.

upstream unicorn {
  server unix:/tmp/unicorn.redmine.sock fail_timeout=0; }

server {
  listen 80 default_server deferred;

location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://unicorn; } }

RE: Redmine 2.5.2 theme not loading / nginx / unicorn - Added by Plam Sim over 9 years ago

Hello Pavel,

Thank you for the proposal. Unfortunately nginx requires most of the directives which I have. With your simple configuration I receive the errors below. I've managed to fix it but unfortunately the issue still persist. Any other ideas?

nginx: [emerg] unknown directive "upstream" in /etc/nginx/nginx.conf:1
nginx: configuration file /etc/nginx/nginx.conf test failed
nginx: [emerg] no "events" section in configuration

However if I add the mandatory part the configuration file works but the issue still persist. The Redmine theme is not loading.

http {

upstream unicorn {
  server unix:/tmp/unicorn.redmine.sock fail_timeout=0; }

server {
  listen 80 default_server deferred;

location / {
    proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    proxy_set_header Host $http_host;
    proxy_redirect off;
    proxy_pass http://unicorn; } }
}

events { worker_connections 1024; }

Pavel Potcheptsov wrote:

Try to simplify config and see how it goes.

RE: Redmine 2.5.2 theme not loading / nginx / unicorn [solved] - Added by Plam Sim over 9 years ago

After server shutdown / power on my redmine is working properly. The issue is solved. I use the configuration above. Thank you Pavel for your help.

    (1-3/3)