pimcore
  1. pimcore
  2. PIMCORE-1638

Correct the old thread about nginx

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Major Major
    • Resolution: Support in the forum please
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Misc Tools
    • Security Level: anyone
    • Labels:
      None

      Description

      I'm an nginx user, and I tried to see if Pimcore runs on nginx. The first Google result was this scary post: http://www.pimcore.org/forum/discussion/133/pimcore-on-nginx-correct-nginx-rules-for-pimcore-solve-this-together-

      Thankfully, I just used a simple nginx config from Wordpress, and Pimcore ran without problems.

      Please,
      1. Correct that thread or delete it.
      2. Create a documentation page for an nginx configuration. Here's mine:



      server {
      server_name example.com;

      root /var/www/example;

      access_log /var/www/example-pimcore/logs/access.log;
      error_log /var/www/example-pimcore/logs/error.log error;

      location / {
      # First attempt to serve request as file, then as directory, then fall back to index.html
      # # try_files $uri $uri/ /index.php/$request_uri;
      try_files $uri $uri/ /index.php?$args;
      index index.php;
      }

      # cache image files
      location ~* \.(jpe?g|gif|png|css|js|ico|pdf)$ {
      access_log off;
      # log_not_found off;
      expires 1w;
      }

      # pass the PHP scripts to FastCGI server listening on 127.0.0.1:9000
      #
      location ~ \.php$ {
      fastcgi_split_path_info ^(.+\.php)(/.+)$;
      # # NOTE: You should have "cgi.fix_pathinfo = 0;" in php.ini
      #
      # # With php5-cgi alone:
      fastcgi_pass 127.0.0.1:9000;
      # # With php5-fpm:
      # fastcgi_pass unix:/var/run/php5-fpm.sock;
      fastcgi_index index.php;
      include fastcgi_params;
      }

      }

        Activity

        Hide
        Bernhard Rusch added a comment -
        Hi,

        I'm afraid that your config doesn't cover all the rules required by pimcore.

        For example:

        RewriteCond %{REQUEST_METHOD} ^GET
        RewriteCond %{DOCUMENT_ROOT}/website/var/assets%{REQUEST_URI} -f
        RewriteRule ^(.*)$ /website/var/assets%{REQUEST_URI} [PT,L]

        RewriteRule ^website/var/tmp.* - [PT,L]
        RewriteRule ^website/var/assets.* - [PT,L]
        RewriteRule ^website/var/plugins.* - [PT,L]
        RewriteRule ^website/var/areas.* - [PT,L]
        RewriteRule ^plugins/.*/static.* - [PT,L]
        RewriteRule ^pimcore/static.* - [PT,L]

        RewriteRule ^website/var/.*$ / [F,L]
        RewriteRule ^plugins/.*$ / [F,L]
        RewriteRule ^pimcore/.*$ / [F,L]

        If you have a complete and working config, it would be cool if you could add it to the wiki / documentation (editing/creating pages is possible for all registered users):
        http://www.pimcore.org/wiki/

        Thanks!
        Show
        Bernhard Rusch added a comment - Hi, I'm afraid that your config doesn't cover all the rules required by pimcore. For example: RewriteCond %{REQUEST_METHOD} ^GET RewriteCond %{DOCUMENT_ROOT}/website/var/assets%{REQUEST_URI} -f RewriteRule ^(.*)$ /website/var/assets%{REQUEST_URI} [PT,L] RewriteRule ^website/var/tmp.* - [PT,L] RewriteRule ^website/var/assets.* - [PT,L] RewriteRule ^website/var/plugins.* - [PT,L] RewriteRule ^website/var/areas.* - [PT,L] RewriteRule ^plugins/.*/static.* - [PT,L] RewriteRule ^pimcore/static.* - [PT,L] RewriteRule ^website/var/.*$ / [F,L] RewriteRule ^plugins/.*$ / [F,L] RewriteRule ^pimcore/.*$ / [F,L] If you have a complete and working config, it would be cool if you could add it to the wiki / documentation (editing/creating pages is possible for all registered users): http://www.pimcore.org/wiki/ Thanks!

          People

          • Assignee:
            Bernhard Rusch
            Reporter:
            Dan Dascalescu
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: