Re: [Mojolicious] Mojolicious::Plugin::AccessLog and x-real-ip behind reverse proxy

2018-10-03 Thread Dan Book
You need to set the 'proxy' configuration for hypnotoad, or if you're not
using hypnotoad, the MOJO_REVERSE_PROXY environment variable. See
https://metacpan.org/pod/Mojolicious::Guides::Cookbook#Reverse-proxy

-Dan

On Wed, Oct 3, 2018 at 6:16 PM Dan Harris  wrote:

> I have a new Mojolicous::Lite application behind an nginx reverse proxy.
> With the AccessLog plugin, the IP address of the reverse proxy is logged
> every time.  The nginx config seems to be OK and it was just working with a
> previous (not-mojolicious) application.  As a test I dumped the Request
> headers in the app and the correct IP address is stored both in 'x-real-ip'
> and in 'x-forwarded-for'.  I am using the "combined" log format for the
> plugin.  It seems like the plugin is not respecting the x-forwarded-for
> header.  Any guidance for me?
>
> Thank you!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Mojolicious" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to mojolicious+unsubscr...@googlegroups.com.
> To post to this group, send email to mojolicious@googlegroups.com.
> Visit this group at https://groups.google.com/group/mojolicious.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


[Mojolicious] Mojolicious::Plugin::AccessLog and x-real-ip behind reverse proxy

2018-10-03 Thread Dan Harris
I have a new Mojolicous::Lite application behind an nginx reverse proxy.  
With the AccessLog plugin, the IP address of the reverse proxy is logged 
every time.  The nginx config seems to be OK and it was just working with a 
previous (not-mojolicious) application.  As a test I dumped the Request 
headers in the app and the correct IP address is stored both in 'x-real-ip' 
and in 'x-forwarded-for'.  I am using the "combined" log format for the 
plugin.  It seems like the plugin is not respecting the x-forwarded-for 
header.  Any guidance for me?

Thank you!

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


[Mojolicious] Re: Javascript in template vs static file thoughts?

2018-10-03 Thread Viktor Nacht
Thank you for the input, it helps. I'm basically in the middle. Right now I 
keep a js file under the public dir in a lightweight module format, but I 
add a script tag at the end of the relevant template with  variables 
holding url_for values for AJAX calls, Javascript arrays for select values, 
etc. I'll see it pans out when I start created AssetPacks out of the js 
code.

Thanks!

V

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.


[Mojolicious] Re: Javascript in template vs static file thoughts?

2018-10-03 Thread Tekki
If a JS file is tightly related to the application (for example a 
Vuejs/Angular module), I use $c->render_to_string to create it at the first 
call and then store it as a static file.

-- 
You received this message because you are subscribed to the Google Groups 
"Mojolicious" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to mojolicious+unsubscr...@googlegroups.com.
To post to this group, send email to mojolicious@googlegroups.com.
Visit this group at https://groups.google.com/group/mojolicious.
For more options, visit https://groups.google.com/d/optout.