{"id":209,"date":"2023-03-12T12:04:00","date_gmt":"2023-03-12T11:04:00","guid":{"rendered":"https:\/\/morc.solutions\/en\/?p=209"},"modified":"2023-03-12T12:04:00","modified_gmt":"2023-03-12T11:04:00","slug":"nginx-alias-vs-roundcube","status":"publish","type":"post","link":"https:\/\/morc.solutions\/en\/nginx-alias-vs-roundcube\/","title":{"rendered":"Nginx alias vs Roundcube"},"content":{"rendered":"\n<p>When you install Roundcube from a distribution package (for example a .deb package on Ubuntu) the package installs files under \/usr\/share\/roundcube\/ If you want to serve Roudncube from a different URI than \/roundcube\/, then you have two options (maybe more):<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Create a softlink with the desired name in the document root folder to the roundcube folder<\/li>\n\n\n\n<li>Use the alias directive of Nginx<\/li>\n<\/ol>\n\n\n\n<p>The problem with the second option is that the default fastcgi.conf Nginx config will create the wrong SCRIPT_FILENAME value, thus PHP will not find the PHP file. The solutions is to overwrite this parameter value with the correct one:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>location \/mail\/ {\n  alias \/usr\/share\/roundcube\/;\n  try_files $uri $uri\/ \/index.php?$args;\n  location ~ .php$ {\n    include snippets\/fastcgi-php.conf;\n    fastcgi_param SCRIPT_FILENAME $request_filename;\n    fastcgi_pass unix:\/run\/php\/php-fpm.sock;\n  }\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>When you install Roundcube from a distribution package (for example a .deb package on Ubuntu) the package installs files under \/usr\/share\/roundcube\/ If you want to serve Roudncube from a different URI than \/roundcube\/, then you have two options (maybe more): &hellip; <a href=\"https:\/\/morc.solutions\/en\/nginx-alias-vs-roundcube\/\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-209","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/morc.solutions\/en\/wp-json\/wp\/v2\/posts\/209","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/morc.solutions\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/morc.solutions\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/morc.solutions\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/morc.solutions\/en\/wp-json\/wp\/v2\/comments?post=209"}],"version-history":[{"count":1,"href":"https:\/\/morc.solutions\/en\/wp-json\/wp\/v2\/posts\/209\/revisions"}],"predecessor-version":[{"id":210,"href":"https:\/\/morc.solutions\/en\/wp-json\/wp\/v2\/posts\/209\/revisions\/210"}],"wp:attachment":[{"href":"https:\/\/morc.solutions\/en\/wp-json\/wp\/v2\/media?parent=209"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/morc.solutions\/en\/wp-json\/wp\/v2\/categories?post=209"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/morc.solutions\/en\/wp-json\/wp\/v2\/tags?post=209"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}