in progress Index Not Found

jimmyk
jimmyk
@jimmy
9 years ago
514 posts
I finished installing Jamroom under Nginx. Only the base modules are installed.

I proceeded to installed the jrCore beta. Once I did this, the main page of the site is showing "Not Found".

Profiles work great, everything is showing up... timeline, blogs, followers, pages. Dashboard is working great. ACP is working except for the image issue I posted.

I uninstalled the Elastic skin and re-installed it, still showing the main page as not found. I can do a direct /index and it will show up.

Is this a setting issue or a bug?
updated by @jimmy: 05/16/16 06:35:28AM
michael
@michael
9 years ago
7,715 posts
(Disclaimer: I know very little about Nginx, what I do know mostly comes from you. :) )

What I would check is: is the index arriving at router.php

So in:
/modules/jrCore/router.php

Put a bit of test code in at the very top:'
/**
 * @copyright 2012 Talldude Networks, LLC.
 * @author Brian Johnson <brian [at] jamroom [dot] net>
 */
echo 'hello world';
exit;
// Define our base dir - DO NOT USE __DIR__ here
define('APP_DIR', dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME']))));

Everything should go through router.php so if the index is not showing, it would be good to know if the server is sending the request to router.php or not.

That
echo 'hello world';
exit;
put into router will cause the screen to show 'hello world' if the URL is being directed to it.

If it does show up it means the jamroom system should be working.
If it doesn't show up it means that the server is not sending that url to where its supposed to and points to a problem in .htaccess (if the server was apache, but its nginx......)
updated by @michael: 12/22/15 04:57:07PM
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
Yup. Router is working fine. Displaying Hello World everywhere on the site. Had to clear out the cache to see it.

The htaccess file for JR is super simple and thus the conversion to nginx is simple also. You should see the laravel htaccess file, that htaccess file goes on forever. They do have it converted for Nginx though.

Also important to note, the header and footer ARE showing on the index - when your test code isn't there.
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
Note: The index was working fine before I upgraded to beta.
michael
@michael
9 years ago
7,715 posts
Is just a matter of narrowing down down down until we hit the actual issue.

If the header and footer are there on index then my above test is useless, its routing. :)

Actually that is really really weird
site.com/
site.com/index

should be displaying the same thing. or in my case /index redirecting to /.

The header and footer are being added in from index.tpl so the question becomes "Why is the beginning of the file and the end of the file showing, but not the middle.....?"

index.tpl from elastic looks like this:
{jrCore_include template="header.tpl"}
// stuff....
{jrCore_include template="footer.tpl"}

Try adding some things to index.tpl "HERE IS THIS THING" and see if that displays.
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
site.com/ is still showing the not found page with the header and the footer - it appears to be showing the 404.tpl

site.com/index is showing the garbage I replaced between the header and the footer.
1.PNG.png
1.PNG.png  •  25KB

2.PNG.png
2.PNG.png  •  20KB


updated by @jimmy: 12/22/15 06:15:50PM
michael
@michael
9 years ago
7,715 posts
ok, so they are not the same page.

Try putting a debug in the 404.tpl page and see if there are any clues in the $_post variable.

Or if you have a debugger, walk through router.php to try to figure out what is not being found.

Should be firing around this section of router.php
//------------------------------------
// System Index
//------------------------------------
elseif (!isset($_post['module']{0}) && !isset($_post['option']{0}) && !isset($_post['module_url'])) {
// THE INDEX SHOULD SHOW IF ALL THOSE OPTIONS ARE TRUE
othewise, if it thinks there is a module there then

            if (function_exists($func)) {
                // default view function
                $out = jrCore_run_module_view_function($func);
            }
            elseif (is_file(APP_DIR . "/skins/{$_conf['jrCore_active_skin']}/{$_post['module']}_index.tpl")) {
                // default module index (note skin override in parse_template)
                $out = jrCore_parse_template('index.tpl', $_post, $_post['module']);
            }
            elseif (is_file(APP_DIR . "/modules/{$_post['module']}/templates/index.tpl")) {
                // default module index (note skin override in parse_template)
                $out = jrCore_parse_template('index.tpl', $_post, $_post['module']);
            }
            else {
                // page/module/option not found
                jrCore_page_not_found();
            }
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
Nothing is the $_post

{$_post}
Array (3)
_uri => "/"
module_url => ""
module => ""

I wish I had a debugger enviro setup, but I don't anymore since I did a clean install of Win10. I guess I have to re-install my Jamroom stuff and get all that setup again, haven't yet.
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
What's weird to me is that every other page shows up fine. If I go anywhere else on the site besides the / I get a page, no problem. It's only on the index page without index.

And it only now happening when I updated to the beta version.
updated by @jimmy: 12/22/15 07:02:00PM
michael
@michael
9 years ago
7,715 posts
What we need to figure out is why the router.php is not sending you to the index.tpl template for the url /

Is it a system I can log in to? Send me the login details if it is and I'll help with this issue.

What I would do would be to put stuff into router.php to find out where its exiting to.

So like we did above, put
echo 'got to SYSTEM INDEX part'
exit;

We need to figure out what path is being taken for /index vs what path is being taken for / and understand why a different path is being taken for each. Once we know that it will be obvious what needs fixing.
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
No, the site is on my local machine, which I'm using to test the Nginx setup. I've tried a bunch of stuff with the vhost conf to see if that was the cause. Since I'm getting the other pages to show up, it leads me to believe that the file is setup correctly. Though... big IF here, I did strip the vhost conf file down and it does show the main page, but then it doesn't show any other page, only the main page. The big WTF for me is that it worked on the stable and now doesn't work on beta?????

Let me play around with it a little bit more. I'm going to re-install JR with the stable version and do the upgrade again. Maybe something got screwed up with the install.

I will look in the router and see if I can figure out what's going on.

Maybe you could take a look at the git history of the router from the stable to the beta and see what was changed. Like I said, it was working before I upgraded the files.
michael
@michael
9 years ago
7,715 posts
Last change to router was a while back:
Quote:
router.php
2015-11-21
Fixes for XSS vulnerability in jrCore_page_table_pager()

router doesn't get changed much as its very integral. and even then the change was just a variable name and one in a series of checks that is pretty trivial.

Seams more likely that the data coming in is evaluating differently, and that could be the result of a module as they can tap into the flow and adjust variables all through the process.
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
Make sense.

Now I'm trying to re-install JR and I'm getting this new error.

Fatal error: require_once(): Failed opening required '/home/nginx/domains/10.0.0.151/public/skins/jrElastic-release-1.2.12/config.php' (include_path='.:/usr/local/lib/php') in /home/nginx/domains/10.0.0.151/public/install.php on line 312

Why can't my life be easy! LOL!

I'm going to create a whole new account and try this again. I think my VM is starting to go loco on my installing JR so many times. Time to do a restart because it was installing fine before.
michael
@michael
9 years ago
7,715 posts
I like the rebase tool of developer tools:
ACP -> DEVELOPER -> DEVELOPER TOOLS -> TOOLS -> REBASE MODULES

With the "delete old modules"

That will take all those modules installed via the marketplace and put them back on the base url
* jrElastic-release-1.2.12 will become:
* jrElastic

That makes life simpler because you dont need to think about any symlinks.
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
Yea, that is nice, I saw a video you made about it.

I got that error on a clean install. So, I think there was some "left over" stuff in the browser or the server. I'm shutting everything down, cleaning caches, and trying again. Though, it's almost 1am here and I'm having a hard time keeping the eyes open. I don't work until next Mon so I have plenty of time to work on this. I was hoping to have this up and running with a brand new template by Mon. [fingers crossed] :)
michael
@michael
9 years ago
7,715 posts
Sorry for the hassle. Wish I just had the answers.
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
There is no need to say sorry. I'm trying to get this working on a new system and there are bound to be some bumps in the road. I appreciate all your guys help! We'll get this solved, it's probably something stupid.

Another thing I found weird was that only images from the jrCore weren't showing up in the ACP. All the other images from other modules were. And when I was in the jrCore image tab - all the images were showing up on the list. Show up on the list, don't show up in-use in the ACP. I created a thread for that one here: https://www.jamroom.net/the-jamroom-network/forum/installation-and-configuration/36650/broken-acp-images-nginx
updated by @jimmy: 12/22/15 10:27:41PM
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
Ok. Just did a clean install of JR stable version, the / is working. All the other links are working. Only thing not working is those images in the ACP. Going to do the update and then rebase and see if that solves the issue.
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
Results: updated JUST jrCore to the latest beta. Once that completed I got a list of other items which needed to be updated, including the jrElastic skin. Before upgrading anything else, I tested out to see if the main page was working, it isn't. I get the Not Found page again. So, it appears that the jrCore is doing something which is now preventing the / from showing up.

On another note, when I refresh the / page (showing NOT FOUND The Page You Requested Was Not Found!), either logged in or logged out I get these errors on the page:

2015/12/23 07:13:21 [error] 3218#3218: *117 open() "/home/nginx/domains/10.0.0.151/public/image/img/skin/jrElastic/bckgrd.png" failed (2: No such file or directory), client: 10.0.0.245, server: 10.0.0.151, request: "GET /image/img/skin/jrElastic/bckgrd.png HTTP/2.0", host: "10.0.0.151", referrer: "https://10.0.0.151/data/cache/jrElastic/S5ecd926e159b031bf152b7ca28f5fcdc.css"
2015/12/23 07:13:21 [error] 3218#3218: *117 open() "/home/nginx/domains/10.0.0.151/public/image/img/module/jrCore/lightbox2-close.png" failed (2: No such file or directory), client: 10.0.0.245, server: 10.0.0.151, request: "GET /image/img/module/jrCore/lightbox2-close.png HTTP/2.0", host: "10.0.0.151", referrer: "https://10.0.0.151/data/cache/jrElastic/S5ecd926e159b031bf152b7ca28f5fcdc.css"
2015/12/23 07:13:21 [error] 3218#3218: *117 open() "/home/nginx/domains/10.0.0.151/public/image/img/module/jrCore/lightbox2-loading.gif" failed (2: No such file or directory), client: 10.0.0.245, server: 10.0.0.151, request: "GET /image/img/module/jrCore/lightbox2-loading.gif HTTP/2.0", host: "10.0.0.151", referrer: "https://10.0.0.151/data/cache/jrElastic/S5ecd926e159b031bf152b7ca28f5fcdc.css"
2015/12/23 07:13:21 [error] 3218#3218: *117 open() "/home/nginx/domains/10.0.0.151/public/image/img/module/jrCore/lightbox2-prev.png" failed (2: No such file or directory), client: 10.0.0.245, server: 10.0.0.151, request: "GET /image/img/module/jrCore/lightbox2-prev.png HTTP/2.0", host: "10.0.0.151", referrer: "https://10.0.0.151/data/cache/jrElastic/S5ecd926e159b031bf152b7ca28f5fcdc.css"
2015/12/23 07:13:21 [error] 3218#3218: *117 open() "/home/nginx/domains/10.0.0.151/public/image/img/module/jrCore/lightbox2-next.png" failed (2: No such file or directory), client: 10.0.0.245, server: 10.0.0.151, request: "GET /image/img/module/jrCore/lightbox2-next.png HTTP/2.0", host: "10.0.0.151", referrer: "https://10.0.0.151/data/cache/jrElastic/S5ecd926e159b031bf152b7ca28f5fcdc.css"

updated by @jimmy: 12/22/15 11:17:27PM
michael
@michael
9 years ago
7,715 posts
Those errors are saying the images arent there which is probably correct if you havent upgraded elastic.

try checking the "log 404 not found" errors setting at:
site.com/core/admin/global/section=general/hl=log_404

open / a few times and see what the error log says.
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
What happened to the errors page? I can't find it in the beta.
michael
@michael
9 years ago
7,715 posts
The search box still works "log".

site.com/core/dashboard/activity

Its moved into the dashboard section.
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
Got a bunch of these errors.

12/23/15 10:26:31AM	10.0.0.245	[jimmy]: 404 Page not found: /

I can confirm: Search box does work!
updated by @jimmy: 12/23/15 07:30:54AM
brian
@brian
9 years ago
10,148 posts
This is all related to how the routing is being handled by nginx. What does your mod_rewrite replacement code look like? (I don't need your entire nginx config file - just the rewrite rules part).

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
This works for every other page on the site and was working perfect under stable. Once I upgraded to beta, the code below worked on every page on the site except the index (/) but did work when I used example.com/index

location / {

try_files  $uri $uri/modules/jrCore/router.php;
        
rewrite ^(.*)$ /modules/jrCore/router.php?_uri=$1;
}
brian
@brian
9 years ago
10,148 posts
jimmyk:
This works for every other page on the site and was working perfect under stable. Once I upgraded to beta, the code below worked on every page on the site except the index (/) but did work when I used example.com/index

That doesn't make sense - nothing was changed in JR's routing from 5.2 to 5.3 - you can see there is no change in the .htaccess file.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
Yea, it's weird. Was working fine on jrCore stable, upgrade to beta and boom... no index page. Though the direct link works example.com/index. I'm working on a stock site with no other mods installed except what is installed with jrCore.

I even tested it without upgrading all the other modules which are in beta, that didn't work either.

Stable = index shows.
Beta = index (/) not found.

I also tested a bunch of mods to the location block, but since every other page is working on the site, I doubt it's the location block.
updated by @jimmy: 12/23/15 08:42:32AM
brian
@brian
9 years ago
10,148 posts
if you enter this:

http://yoursite.com/index

You should be redirected to:

http://yoursite.com

Does that happen?


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
No. It shows http://yoursite.com/index
updated by @jimmy: 12/23/15 08:52:09AM
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
Got the index working. Needed to tweak the rewrite.

BUT - yoursite.com/index still doesn't redirect to /

OLD
rewrite ^(.*)$ $uri/modules/jrCore/router.php?_uri=$1;

NEW
rewrite ^/(.*)$ /modules/jrCore/router.php?_uri=$1 last;

Though, the images in the ACP - only those for jrCore used in the ACP and not on the jrCore images list (those are showing up) don't display.
updated by @jimmy: 12/23/15 09:02:12AM
brian
@brian
9 years ago
10,148 posts
Quote:
Though, the images in the ACP - only those for jrCore used in the ACP and not on the jrCore images list (those are showing up) don't display.

That's because when viewing the core image list it is showing you the direct link to the image - however, when those images are rendered in other places they use a different URL structure (this way the site owner can upload their own image and it will be used instead).

That tells me that routing is still not working correctly.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
Additional...

If I go to the yoursite.com/index with the new rewrite logs me out.

Correction: I was in offline mode, that's why the offline page was showing... but it did log me out.
updated by @jimmy: 12/23/15 09:19:12AM
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
brian:
Quote:
Though, the images in the ACP - only those for jrCore used in the ACP and not on the jrCore images list (those are showing up) don't display.

That's because when viewing the core image list it is showing you the direct link to the image - however, when those images are rendered in other places they use a different URL structure (this way the site owner can upload their own image and it will be used instead).

That tells me that routing is still not working correctly.

But why would every other image work in the ACP. It only seems like a certain set of images are not working. I would figure that every image wouldn't be working. I see all the icons for all the modules, etc. Obviously, you'd know more about how those are displayed in the ACP than I do.. if the icons for the modules were direct or not.
updated by @jimmy: 12/23/15 09:08:21AM
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
I've tried so many different things in the location block in the vhost conf. The way I have it now has been the only way its worked. And your htaccess file isn't that complicated. You direct everything through the router.
updated by @jimmy: 12/23/15 09:27:47AM
brian
@brian
9 years ago
10,148 posts
Quote:
But why would every other image work in the ACP. It only seems like a certain set of images are not working.

Correct - I outlined why above but maybe it wasn't clear.

If you directly link to an image - i.e.

http://yoursite.com/modules/jrCore/img/option_pass.png

That will show because that image actually exists on the file system.

However, so Jamroom can support the admin uploading a CUSTOM image, when the image is shown on the site the URL will be changed to:

http://yoursite.com/image/img/module/jrCore/option_pass.png

See how the URL is different? This routes the image request through the Image Core module - inside it says:

Is there a CUSTOM image that has been uploaded for the "module" "jrCore" "option_pass.png" file?

If YES - show the custom image (which will be located in the data/media/0/0 directory)
if NO - show the default image (which is located at modules/jrCore/img)

That's why the images work when you view them in the IMAGES tab (since they just point directly to the image included with the module or skin), but do NOT work when viewed elsewhere.

Hopefully that is more clear.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

updated by @brian: 12/23/15 09:57:13AM
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
Gotcha.

I don't really know what else I can convert in the location block to make those work or the index (/) page to start working again on the beta. Your htaccess file is pretty simple - route everything through the router. Unless there's a htaccess file somewhere else that has a rewrite that I need to account for.

On a positive note, only a few issues and this works on Nginx.

FYI - jamroom.net/index doesn't re-direct to (/) - just tested it.
brian
@brian
9 years ago
10,148 posts
I think to get any further on this I'll need to setup a test install here of nginx - I will try to do that as soon as I can. We're a big short handed this week with the holidays so I'm not sure how quickly I can do it, but I'm hoping it wouldn't take me long.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
Sounds like a plan. You should setup centminmod. It's seriously one line of code on top of a centos min image for a fully working LEMP. No control panel stuff, no fees, etc. He actually set it up for his use and it took off to be quite a project that people love. Everything is on github if you want to look at it too.

Github
https://github.com/centminmod

Centminmod install
http://centminmod.com/download.html#method3

Centminmod Site
http://centminmod.com

The developer knows what he's doing... and is a really nice guy. You two would probably get along very well. :)
updated by @jimmy: 12/23/15 10:20:21AM
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
Here is the forum for centminmod
https://community.centminmod.com/

Also the JR thread I created.
https://community.centminmod.com/threads/jamroom.5051/
brian
@brian
9 years ago
10,148 posts
I had a little time over the last couple days and got an nginx setup running. JR works with this as the nginx config:

server {
        listen 80 default_server;
        listen [::]:80 default_server ipv6only=on;
        client_max_body_size 256M;
        root /usr/share/nginx/html;
        server_name ubuntu.jamroom.net;
        access_log /var/log/nginx/access.log;
        error_log /var/log/nginx/error.log;

        location @rewrite {
            rewrite ^(.*)$ /modules/jrCore/router.php?_uri=$1 last;
        }

        location / {
            autoindex on;
            index index.html index.php sitemap.xml /modules/jrCore/router.php;
            try_files $uri $uri/ @rewrite;
        }
        location ~ \.php$ {
                fastcgi_split_path_info ^(.+\.php)(/.+)$;
                fastcgi_pass unix:/var/run/php5-fpm.sock;
                fastcgi_index index.php;
                include fastcgi_params;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        }
}

However the INDEX page will not work until I get the next beta out - there's a small tweak in the core router that is needed for nginx since it sets it uses a slightly different URI on the index than Apache.

Also - change this:

server_name ubuntu.jamroom.net;

to use your actual domain name. I believe that is working 100%.

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net

updated by @brian: 12/26/15 05:30:30AM
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
I'll give that a try. Did you get those images to work in the ACP?
brian
@brian
9 years ago
10,148 posts
jimmyk:
I'll give that a try. Did you get those images to work in the ACP?

Everything is working 100%.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
jimmyk
jimmyk
@jimmy
9 years ago
514 posts
Thanks Brian for addressing this issue so quickly. Do you have an idea when the next jrCore beta is going to be released?

@michael we spoke in another thread about module creation and selling in the marketplace (which has probably closed by now - it was awhile ago). You said that you needed to check out a module before you could give me access to additional features on this site (documentation, forum, and selling ability). Where I do send the module that I've finished for you to review? Do you have an email address or do I just send it to the support email with a reference to you?
jimmyk
jimmyk
@jimmy
8 years ago
514 posts
Any idea on when the next beta is going to be released? I'm creating a custom template and would like to work on the beta vs. stable.

Thanks!
michael
@michael
8 years ago
7,715 posts
Sorry. I thought your account had already been moved over to a 3rd party developer, just checked now and it hasn't, so I've changed it.

You should see more buttons on your profile now.

Check out this doc for how to package modules:

Docs: "Packaging a module for the Marketplace"
https://www.jamroom.net/the-jamroom-network/documentation/development/3440/packaging-a-module-for-the-marketplace

Its one of the developer docs:

Docs: Developer Table of contents
https://www.jamroom.net/the-jamroom-network/documentation/development
jimmyk
jimmyk
@jimmy
8 years ago
514 posts
Thanks, I appreciate it. Any idea on jrCore beta 10? There are some changes in that version I need for Nginx. Since, I'm working on a template I want to make sure I'm working on the future version. If there isn't an ETA at this time, no problem.
michael
@michael
8 years ago
7,715 posts
This is the changelog for b10
Verion 5.3.0b10:
 - Bug Fix: Saving Global Config for non-active skin not saving changes correctly
 - Bug Fix: Some uploaded files with single quotes in the file name may fail
 - Bug Fix: module override templates for disabled modules in active skin still showing
 - Bug Fix: Searches in page search containing a forward slash resulting in 404 not found
 - Bug Fix: Tinymce strips out script tags even if jamroom allows them

Brian usually decides on the release dates, so I'll point out your interest here in case he misses it.
jimmyk
jimmyk
@jimmy
8 years ago
514 posts
Thanks @michael! :-) Below is a quote from Brian about the tweak which is from above in this thread.

brian:
However the INDEX page will not work until I get the next beta out - there's a small tweak in the core router that is needed for nginx since it sets it uses a slightly different URI on the index than Apache.
jimmyk
jimmyk
@jimmy
8 years ago
514 posts
Sweet... just saw the new beta is out. Thanks @brian and @michael
brian
@brian
8 years ago
10,148 posts
jimmyk:
Sweet... just saw the new beta is out. Thanks @brian and @michael

No problem. This is the last beta release of 5.3 - I don't believe there are going to be any more changes that affect nginx - you should be good.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
jimmyk
jimmyk
@jimmy
8 years ago
514 posts
I haven't had a chance to test out the new release yet. Hopefully, I do that tomorrow. I'll let you know if I run into anything. Thanks again!
jimmyk
jimmyk
@jimmy
8 years ago
514 posts
Just got a chance to check it out.

Index page is now working.

Still having an issue with the images in the ACP.
Untitled-2.jpg
Untitled-2.jpg  •  226KB


updated by @jimmy: 02/14/16 04:36:21PM
jimmyk
jimmyk
@jimmy
8 years ago
514 posts
Looks like I found the issue.

There is a location for staticfiles in Centminmod.

   location ~* \.(3gpgifjpgjpegpngicowmvaviasfasxmpgmpegmp4plsmp3midwavswfflvexeziptarrargztgzbz2uha7zdocdocxxlsxlsxpdfiso)$ {
	gzip_static off;
	#add_header Pragma public;
	add_header Cache-Control "public, must-revalidate, proxy-revalidate";
	access_log off;
	expires 30d;
	break;
        }

@brian the above isn't playing nice with the images in the ACP (see screen shot above) any thoughts? I can remove it for JR but having this included works for every other script I've installed and I'm not having any other issues with any of the other images on the site... just the ACP images.

I asked the centminmod developer https://community.centminmod.com/posts/26574/ if I could just remove the above and he said:

Quote:
"What is an example url link to the broken image ? and where does that image reside on local path ?"
depends on that

Any ideas?
updated by @jimmy: 02/14/16 05:41:05PM
brian
@brian
8 years ago
10,148 posts
Yeah that is going to cause an issue - it assumes all images are located at a DIRECT URL (i.e. the path points to a real file) - in JR however, these small images go through a view that outputs the correct image based on whether or not the admin has uploaded a custom image.

I think what we want to figure out is how to exclude your JR domain from that rule - something like:

location ~ /jrdir {
    # empty match for your JR directory
}

# other location blocks..

You might need to play with it but that's the idea I think you'll need to use.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
jimmyk
jimmyk
@jimmy
8 years ago
514 posts
I'm not sure I want to exclude that rule for the entire JR site. Since it's only affecting a select group of images in the ACP couldn't there be a sort of work around for this?

I could create a new staticfiles.conf file for just my JR site on the server. But like I said above, I wouldn't be able to use any of the settings for all the other images on the site which aren't affected by this.

I'm trying to do a specific rule for the jrCore directory. We'll see what happens.


updated by @jimmy: 02/15/16 10:57:58AM
jimmyk
jimmyk
@jimmy
8 years ago
514 posts
@brian most of the files with the extensions (3gpgifjpgjpegpngicowmvaviasfasxmpgmpegmp4plsmp3midwavswfflvexeziptarrargztgzbz2uha7zdocdocxxlsxlsxpdfiso) are going to be in either the skins and the data directory, correct? If so, I can apply the rule to both those directories and omit the modules directory?
jimmyk
jimmyk
@jimmy
8 years ago
514 posts
I believe I figured it out. What I did was create 3 locations for the directories:

location ~^(/modules/).*(\.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso))$ {
	gzip_static off;
	#add_header Pragma public;
	add_header Cache-Control "public, must-revalidate, proxy-revalidate";
	access_log off;
	expires 30d;
	break;
        }
    location ~^(/data/).*(\.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso))$ {
	gzip_static off;
	#add_header Pragma public;
	add_header Cache-Control "public, must-revalidate, proxy-revalidate";
	access_log off;
	expires 30d;
	break;
        }
    location ~^(/skins/).*(\.(3gp|gif|jpg|jpeg|png|ico|wmv|avi|asf|asx|mpg|mpeg|mp4|pls|mp3|mid|wav|swf|flv|exe|zip|tar|rar|gz|tgz|bz2|uha|7z|doc|docx|xls|xlsx|pdf|iso))$ {
	gzip_static off;
	#add_header Pragma public;
	add_header Cache-Control "public, must-revalidate, proxy-revalidate";
	access_log off;
	expires 30d;
	break;
        }

I can use the three above and the images show. If I try one of the location blocks with:

/image/img/module/jrCore/

the ACP jrCore images don't show. So, I know it's working on all the images except that specific location, which happens to be the location for those ACP images.
updated by @jimmy: 02/15/16 11:25:17AM

Tags