Help
Ask questions about how to do or fix things in Arrowchat
User avatar
Martok
Customer
 
Posts: 71
Joined: 26 Jun 2012, 05:04

 

by Martok 20 Jun 2017, 09:44

Arrowchat is advertised as working on any web server and includes an image of Nginx. However, no provision seems to have been made for rewrites - only Apache rewrites in the .htaccess file in the Arrowchat root are provided.

Please can you provide the necessary rewrites for Nginx, particularly for these:

RewriteRule ^chatroom ^/../public/chatroom/ [L]
RewriteRule ^cron ^/../public/cron/ [L]
RewriteRule ^debug ^/../public/debug/ [L]
RewriteRule ^list ^/../public/list/ [L]
RewriteRule ^mobile ^/../public/mobile/ [L]
RewriteRule ^popout ^/../public/popout/ [L]
RewriteRule ^video ^/../public/video/ [L]

I know where to put rewrites in Nginx, I just can't seem to get anything to work, so currently /arrowchat/mobile/ doesn't work (which of course should rewrite to /arrowchat/public/mobile/). I'm also not sure what effect not having the other rewrites currently will have.
User avatar
Jason
ArrowChat Team
 
Posts: 2175
Joined: 12 Dec 2009, 16:06

 

by Jason 20 Jun 2017, 11:26

The rewrites aren't required at all (or they shouldn't be) as everything internally will default to the public folder.
User avatar
Martok
Customer
 
Posts: 71
Joined: 26 Jun 2012, 05:04

 

by Martok 22 Jun 2017, 04:27

Jason wrote:The rewrites aren't required at all (or they shouldn't be) as everything internally will default to the public folder.

The rewrites are used though, as you can see on this site. https://www.arrowchat.com/arrowchat/mobile/ will bring up the mobile chat. The URL remains the same (as you can see in the browser) and it is working because /arrowchat/mobile/ has been rewritten to /arrowchat/public/mobile/.

Without the rewrites in place, /arrowchat/mobile/ doesn't work (try removing the .htaccess file and you'll see that). I have no idea what issues there are by not having the other rewrites in place.

Therefore it does seem as though redirects need to be provided for nginx.

As I said, I've had a go at trying to write the nginx ones myself but with no success. I guess it's because I'm not entirely clear how the Apache rewrites are working. For example:

RewriteRule ^mobile ^/../public/mobile/ [L]

This appears to be saying for URLs with 'mobile' in them (when in the arrowchat folder) the rewrite is to the 'parent directory'/public/mobile/ (though I could be mistaken). The reason I'm confused is the 'parent directory' bit, the htaccess file already is in the arrowchat folder and there's nothing in the parent directory (apart from the arrowchat directory itself) and the rewrite is from example.com/arrowchat/mobile/ to example.com/arrowchat/public/mobile.
User avatar
Martok
Customer
 
Posts: 71
Joined: 26 Jun 2012, 05:04

 

by Martok 22 Jun 2017, 09:03

Martok wrote:there's nothing in the parent directory (apart from the arrowchat directory itself) and the rewrite is from example.com/arrowchat/mobile/ to example.com/arrowchat/public/mobile.

That's meant to read there's nothing arrowchat-related in the parent directory (apart from the arrowchat directory itself)
User avatar
Jason
ArrowChat Team
 
Posts: 2175
Joined: 12 Dec 2009, 16:06

 

by Jason 23 Jun 2017, 10:25

Yes, I understand that the rewrites are used, but they shouldn't be required. For example, when you click on the mobile tab, it directs users to the /public/ folder by default. What specifically is broken without the rewrites?
User avatar
GAbrams
Customer
 
Posts: 3
Joined: 16 Jan 2011, 14:21

 

by GAbrams 27 Jun 2017, 21:15

I am using arrowchat with nginx without any rewrites. As far as I can tell they aren't necessary. For example, there is no need to go to /arrowchat/mobile/ but only to /arrowchat/public/mobile/. When I use my mobile phone, the arrowchat software only directs my client to /arrowchat/public/mobile/ never to /arrowchat/mobile. I don't know why the .htaccess is there unless it's for seo or compatibility with some previous version links.
User avatar
Martok
Customer
 
Posts: 71
Joined: 26 Jun 2012, 05:04

 

by Martok 28 Jun 2017, 03:50

Jason wrote:Yes, I understand that the rewrites are used, but they shouldn't be required. For example, when you click on the mobile tab, it directs users to the /public/ folder by default. What specifically is broken without the rewrites?

I don't use the mobile tab (as I dislike its permanence on mobile screens and I think it's too big). Instead I have a link on my site that has the URL arrowchat/mobile (in actual fact, the link is just to arrowchat/ but I edited the index.php file so that http://www.mysite.com/arrowchat takes you to the mobile chat rather than the admin login page). When using Apache, clicking on this link shows http://www.mysite.com/arrowchat/mobile/ in the browser (but it is actually at http://www.mysite.com/arrowchat/public/mobile/ due to the Apache rewrite). With Nginx, I want to have the same thing but it doesn't work without an Nginx rewrite.
As I mentioned, you can see this on your site - whilst the mobile tab does take you to www.arrowchat.com/arrowchat/public/mobile/ if you type in www.arrowchat.com/arrowchat/mobile/ it takes you to the mobile chat and keeps the shorter URL (without public in it).


GAbrams wrote:I am using arrowchat with nginx without any rewrites. As far as I can tell they aren't necessary. For example, there is no need to go to /arrowchat/mobile/ but only to /arrowchat/public/mobile/. When I use my mobile phone, the arrowchat software only directs my client to /arrowchat/public/mobile/ never to /arrowchat/mobile. I don't know why the .htaccess is there unless it's for seo or compatibility with some previous version links.

I realise that I can just change the link to arrowchat/public/mobile/ but it's a longer URL. I'd much rather have the shorter URL (in my case just simply arrowchat/ due to my edit of the index.php file above) that I can use in my sites links and members of my site can easily remember (http://www.mysite.com/arrowchat).
User avatar
MBashlakov
Customer
 
Posts: 8
Joined: 13 Apr 2020, 21:14

 

by MBashlakov 19 Oct 2020, 12:16

Martok, were you able to get this to work without Nginx rewrites? I am having the same problem. Moving from Apache to Nginx, and I can't get it to work. Can you share you solution, or anyone for that matter?