-
-
Notifications
You must be signed in to change notification settings - Fork 615
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nginx Documentation #345
Nginx Documentation #345
Conversation
_title: Advanced Configuration Tips | ||
modular-pico-config: Modular Pico Config | ||
nav-url: /docs/ | ||
gh_release: v1.0.2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not used
I wasn't sure about those. I had just based it on another page, so I left them in. Thanks. |
|
||
``` | ||
location / { | ||
try_files $uri $uri/ /?$uri&$args |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing ';'
Thanks, those semi-colons are the bane of my existence. I leave them off at least once every time I edit a config file. >.< Unfortunately, it won't work in the Pico location block. It needs to send the variable externally to PHP, and because of how the blocks are processed, it won't "remember" it from the Pico block when it gets to the php block. It's a two-step process, first the url is rewritten to "/?some/page/url" using the Pico block, then it checks it again and matches it against the PHP block. It then sends the page to |
Ah, ic, thanks for the explanation 😃 |
try_files $uri $uri/ /pico/?$1&$args; | ||
} | ||
If you're using Nginx, you can use the following configuration to enable URL rewriting. Don't forget to adjust the path (`/pico`; line `1` and `4`) to match your installation directory. You can then enable URL rewriting by setting `$config['rewrite_url'] = true;` in your `config/config.php`. | ||
``` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub Pages (i.e. Kramdown) unfortunately doesn't support fenced code blocks correctly (three different Markdown parses are a pain...). See http://smcdougall.github.io/Pico/docs/#nginx-configuration. But indentation works fine 😃
Huh, wow, I did not notice that. Why does it work in (I put it in a code block because the |
Oops, that was supposed to reissue the same commit... guess I did it wrong. 😆 (Figured it out) |
Ah, no, Kramdown does support fenced code blocks, but it requires you to add a empty line before and after the fenced code block. |
Ah, okay. Should be fixed now. |
|
||
``` | ||
location ~ ^/pico(.*) { | ||
try_files $uri $uri/ /pico/?$1&$args; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
/pico/index.php?$1&$args;
, see above
I don't know if it really saves a "round trip" or not. My assumption for how it works is that it would just "tack on" the name of the index file if unspecified. Either way, I'll add |
|
||
### Modular Pico Config | ||
|
||
Let's say you're a real Pico enthusiast and have several Pico websites running on the same server. You may get tired of writing all these rules into each and every server configuration. An easier solution might be to place all the common components (index, access denials, php rules) into a separate file and include it using `include /absolute/path/to/file`. You could also add the rewrite rule to this file, but a better option would be to include a second file, that way you can chose to include it *only* when Pico is located in your Document Root. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's a good idea to let the components, i.e.
An easier solution might be to place all the common components (index, access denials, php rules) into a separate file
directly link to the appropriate sections above 😃
Considering you're from Germany.... it would probably be in poor taste to call you a "Documentation Nazi", huh? 😒 Seriously though, I appreciate all the help. 😉 |
👍 |
I've tested |
😒 I just realized I could have replied to each of your comments inside the line-note. I don't know, I guess I just thought that button was for adding a new note. 😞 |
Okay, I've finished reading. Reading and fixing should never happen simultaneous 😉 Anyway, I'll answer your comments here this time. General notes: After you've finished your work I'll read it again and merge it (that's not urgent! Do it whenever you've time for it). Again, I cannot emphasise enough that the document is great! 👍 Section "Getting Started", first paragraph: #345 (comment)
Yeah, I like that! 👍 Splitting the document into subsections: #345 (comment)
True. "Nginx Configuration" sounds good. This is completely up to you, it just came to my mind immediately after reading this sentence. How to name Nginx and HTTPS: #345 (comment) + #345 (comment) Directory listing ( Denying access globally: #345 (comment) Moving the "Deny access" section below "PHP Configuration": #345 (comment) PHP with nginx vs. PHP with Apache: #345 (comment) OS-Dependant examples: #345 (comment)
|
@@ -0,0 +1,192 @@ | |||
--- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you please move the file to in-depth/nginx.md
?
My excuse is that I was thinking that adding a new line note would put it at the end of the thread anyway. I didn't realize until I clicked on it that it would create a little sub-thread for the reply. It makes sense though, and seems handy. I'll use that next time.
Me too. I understand. 😆 |
So it's safe to remove Honestly, I've just been including the line because I've seen it a lot in examples... I don't actually know what purpose it serves on the PHP side of things or what that path information is used for. 😅 |
Yes, you can safely remove The purpose of this directive is to imitate the |
sigh So I don't really have a better option for the denial rule at the moment. I added a little note about it in-case it causes issues. I don't really think it's worth the extra effort at this point when I'll probably have to rewrite half the document for In the future, a solution might be a I experimented a little while back with adding a separate Perhaps by declaring a Pico Just speculating at the point, but it would be worth looking into in the future. 😄 Also, in regards to adding a new subsection to the document where I don't know. As always, I'm open to any arguments you have in favor of it, I just don't think it adds any benefit right now. And, I think that's everything. Let me know if I've forgotten to address any points we discussed. And sorry for the extra long reply. 😅 |
Using I've merged your PR with some very minor changes (see fa07158). 🎉 Thank you for your efforts @smcdougall, absolutely great work! 👍 😃 |
Rough draft is complete. Still needs further revision and editing, but I wanted to share what I've gotten done so far.
View-able at http://smcdougall.github.io/Pico/nginx/
Any input is appreciated. 😃