Neuigkeiten
  • Die modified eCommerce Shopsoftware ist kostenlos, aber nicht umsonst.
    Spenden
  • Damit wir die modified eCommerce Shopsoftware auch zukünftig kostenlos anbieten können:
    Spenden
  • Thema: modified on Nginx webserver

    fish

    • Neu im Forum
    • Beiträge: 2
    modified on Nginx webserver
    am: 17. Juni 2013, 10:26:04
    Hallo Zusammen,
    ich bin grade dabei von einem Apache auf einen Nginx Webserver umzuziehen. Nginx verwendet keine htaccess, stattdessen wird alles in eine config Datei hinterlegt. Es gibt einen Converter der diese Arbeit übernehmen soll… (http://winginx.com/htaccess)
    Der Admin Bereich und Startseite funktioniert. Content und Produkte aber nicht, egal ob mit seo url oder ohne. Kann mir bitte einer helfen.
    Hier meine config: (ohne seo uhl)

    location /myshop/ {
      alias /home/fish/myshop/;
    }

    location ~ ^/myshop/(.+\.php)$ {
         alias /home/fish/myshop/$1;
         fastcgi_pass 127.0.0.1:9000;
         fastcgi_index  index.php;
         fastcgi_param  SCRIPT_FILENAME  $request_filename;
         include fastcgi_params;
        }
    ###############################################################
    ## mit seo uhl ##
    ###############################################################
    location /myshop/ {
      alias /home/fish/myshop/;
    #  Sitemap
    location /sitemap { rewrite ^/sitemap(.*)\.html$ /shop_content.php?coID=8 break; }

    #Kategorien
    if ($request_uri ~ "(.*)---([_0-9]+)-([_0-9]+)\.html$"){
    rewrite (.*)---([_0-9]+)-([_0-9]+)\.html$ /index.php?cPath=$2&page=$3 break; } if ($request_uri ~ "(.*)---([_0-9]+)\.html$"){
     rewrite (.*)---([_0-9]+)\.html$ /index.php?cPath=$2 break; }

    # Produkte
    rewrite (.*)--(.+)\.html$ /product_info.php?products_id=$2 break;

    # Content
    rewrite (.*)-_-([0-9]+)\.html$ /shop_content.php?coID=$2 break;

    # Manufacturers
    if ($request_uri ~ "(.*)-.-([_0-9]+)-([_0-9]+)\.html$"){
     rewrite (.*)-.-([_0-9]+)-([_0-9]+)\.html$ /index.php?manufacturers_id=$2&page=$3 break; } if ($request_uri ~ "(.*)-.-([_0-9]+)\.html$"){
     rewrite (.*)-.-([0-9]+)\.html$ /index.php?manufacturers_id=$2 break; }

    }

    location ~ ^/myshop/(.+\.php)$ {
         alias /home/fish/myshop/$1;
    fastcgi_pass 127.0.0.1:9000;
         fastcgi_index  index.php;
         fastcgi_param  SCRIPT_FILENAME  $request_filename;
         include fastcgi_params;
        }

    Danke!

    Linkback: https://www.modified-shop.org/forum/index.php?topic=26623.0
    Shop Hosting

    inox

    • Neu im Forum
    • Beiträge: 45
    Re: modified on Nginx webserver
    Antwort #1 am: 01. März 2014, 17:18:13
    Hallo fish,

    bist Du denn weitergekommen mit der Migration? Ich bin gerade dabei mich in nginx einzulesen, würde natürlich gern etwas darüber erfahren ob und wie Modified unter nginx läuft.

    Danke & Gruß
    inox

    cauboy

    • Neu im Forum
    • Beiträge: 3
    Re: modified on Nginx webserver
    Antwort #2 am: 10. Februar 2016, 10:23:42
    Zwar ist das Topic nicht mehr aktuell, aber vielleicht hilft es ja noch jemandem. Mit diesen Einstellungen funktioniert modified shop bei mir mit Nginx

    Code: Bash  [Auswählen]
    server {
       listen            80;
       server_name       my.domain.com;
       root              /path/to/shop;
       gzip on;

       # Sitemap
       rewrite ^/sitemap(.*)\.html$ /shop_content.php?coID=8 last;

       # Categories (:::)
       rewrite ^/.*:::([_0-9]+)\.html$ /index.php?cPath=$1 last;
       rewrite ^/.*:::([_0-9]+):([_0-9]+)\.html$ /index.php?cPath=$1&page=$3 last;

       # Products (::)
       rewrite ^/.*::([0-9]+)\.html$ /product_info.php?products_id=$1 last;

       # Content (:_:)
       rewrite ^/.*:_:([0-9]+)\.html$ /shop_content.php?coID=$1 last;

       # Manufacturers (:.:)
       rewrite ^/.*:\.:([_0-9]+):([_0-9]+)\.html$ /index.php?manufacturers_id=$1&page=$2 last;
       rewrite /.*:\.:([_0-9]+)\.html$ /index.php?manufacturers_id=$1 last;

       location / {
            index          index.php index.html index.htm;
       }

       location ~ \.php$ {
           fastcgi_pass   127.0.0.1:9000;
           fastcgi_index  index.php;
           fastcgi_param  SCRIPT_FILENAME  $document_root$fastcgi_script_name;
           include        fastcgi_params;
       }
    }
     

    h-h-h

    • modified Team
    • Beiträge: 4.562
    Re: modified on Nginx webserver
    Antwort #3 am: 10. Februar 2016, 16:19:55
    Und bitte an die Sicherheit denken:

      # deny access to includes and inc php files
      location ^/(includes|inc).*\.php$ { deny all; }

      #  deny access to cache, backups, download and templates_c
      location ~ ^/(cache|backups|download|templates_c) { deny all; }

      # disallow direct access to templates .html and .php files
      location ~ ^/templates.*\.(html|php) { deny all; }

      # disallow direct access to lang .html and .conf files
      location ~ ^/lang.*\.(html|conf) { deny all; }

    if ($http_host ~ "^shopname.de$"){
       rewrite ^/(.*)$ $scheme://www.$http_host/$1 redirect;
     }

    htpasswd f. Admin:
    location /admin/ {
        auth_basic "Login Adminbereich";
        auth_basic_user_file htpasswd/shopname_admin;
      }

    Besten Gruß,
    h-h-h

    0815

    • Viel Schreiber
    • Beiträge: 905
    Re: modified on Nginx webserver
    Antwort #4 am: 06. Juni 2018, 21:44:17
    Moin,

    müssen die Codezeilen aus Beitrag 2 und 3 alle in die .htaccess?
    Wird der Code nur hinzugefügt, oder müssen dafür andere Zeilen entfernt werden?

    Mein Shop (ein Modified Multishop) basiert in großen Teilen noch auf der Version 1.06.

    Danke

    h-h-h

    • modified Team
    • Beiträge: 4.562
    Re: modified on Nginx webserver
    Antwort #5 am: 07. Juni 2018, 01:02:51
    Moin 0815,

    hier geht es um Nginx (sprich engine-ex) als alternative zu Apache HTTP Server.

    Da nginx mit .htaccess Dateien nicht umgehen kann, muss die Konfiguration für Nginx umgeschrieben werden.

    Gruß, h-h-h

    0815

    • Viel Schreiber
    • Beiträge: 905
    Re: modified on Nginx webserver
    Antwort #6 am: 07. Juni 2018, 08:36:53
    Heute um 01:03 Uhr kam eine Mail mit der Info "In diesem Thema wurde eine Antwort von h-h-h geschrieben."

    ... Beitrag versehentlich, oder absichtlich wieder entfernt?

    Timm

    • Fördermitglied
    • Beiträge: 6.258
    Re: modified on Nginx webserver
    Antwort #7 am: 07. Juni 2018, 11:25:32
    Bei Bitpalast hat man einen Apache vor den Nginx geschalten, der die dynamischen Sachen ausführt und der Nginx nur die statischen. Das ist auch sehr schnell und erspart einem die Anpassungen in der .htaccess.

    Gruß Timm
    7 Antworten
    1031 Aufrufe
    19. März 2023, 18:52:25 von Timm
    7 Antworten
    3240 Aufrufe
    09. Mai 2020, 21:41:41 von Zen10
    5 Antworten
    3649 Aufrufe
    23. März 2015, 17:28:15 von Fakrae