Skip to content

Commit

Permalink
Move to nginx format
Browse files Browse the repository at this point in the history
  • Loading branch information
dlangille committed Nov 4, 2017
1 parent ebb5215 commit a67087e
Showing 1 changed file with 28 additions and 77 deletions.
105 changes: 28 additions & 77 deletions configuration/virtualhost-common.conf.sample
Original file line number Diff line number Diff line change
@@ -1,78 +1,29 @@
CBandRemoteSpeed 3GB/s 100 20
server_name www.freshports.org;
root /usr/local/www/freshports/www/;
index index.php index.html;

error_log /var/log/nginx/freshports.org-error.log;
access_log /var/log/nginx/freshports.org-access.log combined;

location / {
try_files $uri $uri/ @missing;
}

location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}

location @missing {
rewrite ^ /--/index.php break;

fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/var/run/php-fpm.sock;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $request_filename;
include fastcgi_params;
}

ErrorDocument 404 /missing.php

<Directory /usr/websites/freshports.org/www>
Options +FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
</Directory>

<Directory /usr/websites/freshports.org/www/backend>
Options FollowSymLinks
</Directory>

<Location /docs>
IndexOptions FancyIndexing NameWidth=* DescriptionWidth=*
Options Indexes FollowSymLinks
AddDescription "Using 404 errors to serve up virtual pages and virtual categories" 404-for-virtual-pages.php
AddDescription "sample xml file for a commit message from FreeBSD's cvs-all mailing list" commits.xml
AddDescription "another samle xml file" commits_2.xml
AddDescription "The data definition document for the FreshPorts/FreshSource XML" fp-updates.dtd
AddDescription "FreshPorts/FreshSource database diagram" physical_database.gif
AddDescription "A sample email" sample_message.1
AddDescription "The xml produced from sample_message.1 by code in the scripts directory" sample_message.1.xml
AddDescription "more information about this directory" README.txt
AddDescription "perl module needed by process_cvs_mail.pl" constants.pm
AddDescription "raw email to be used as sample input" email.txt
AddDescription "xml output by process_cvs_mail.pl" email.xml
AddDescription "the perl code used to convert email to xml" process_cvs_mail.pl
AddDescription "Sample scripts for FreshPorts" scripts
</Location>

RewriteEngine On

# we are retiring commits.php and using index.php exclusively
RewriteRule ^/commits.php$ / [R=permanent]


# look for stuff in the old /news/ directory
# we put php files in that directory in error
# and it conflicts with a category
#
RewriteRule ^/rss/watch-list.php$ /backend/watch-list.php [R=permanent]
RewriteRule ^/newsfeeds.php$ /backend/newsfeeds.php [R=permanent]
RewriteRule ^/rss/ports-new.php$ /backend/ports-new.php [R=permanent]
RewriteRule ^/sidebar.php$ /backend/sidebar.php [R=permanent]
RewriteRule ^/news.php3$ /backend/rss0.91.php [R=permanent]
RewriteRule ^/news.php$ /backend/rss0.91.php [R=permanent]
RewriteRule ^/news/atom0.3.php$ /backend/atom0.3.php [R=permanent]
RewriteRule ^/news/html.php$ /backend/html.php [R=permanent]
RewriteRule ^/news/js.php$ /backend/js.php [R=permanent]
RewriteRule ^/news/mbox.php$ /backend/mbox.php [R=permanent]
RewriteRule ^/news/opml.php$ /backend/opml.php [R=permanent]
RewriteRule ^/news/pie0.1.php$ /backend/pie0.1.php [R=permanent]
RewriteRule ^/news/rss0.91.php$ /backend/rss0.91.php [R=permanent]
RewriteRule ^/news/rss1.0.php$ /backend/rss1.0.php [R=permanent]
RewriteRule ^/news/rss2.0.php$ /backend/rss2.0.php [R=permanent]

RewriteRule ^/(.*)/(.*)/files\.php$ /commit.php?category=$1&port=$2&files=yes [R=permanent,QSA]


RewriteCond %{HTTP_REFERER} .*freshports.net*
RewriteRule .* /fraud/fraud.php

RewriteRule modules/coppermine http://news.freshports.org/2006/11/09/coppermining/ [R=permanent]
RewriteRule ^/www/smarty_config.php$ http://news.freshports.org/2006/11/09/coppermining/ [R=permanent]
RewriteRule ^/admin/upgrade.php$ http://news.freshports.org/2006/11/09/coppermining/ [R=permanent]

<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes

mod_gzip_item_include mime ^text/
mod_gzip_item_include mime ^httpd/unix-directory
mod_gzip_item_include mime ^application/.*xml
mod_gzip_item_include mime ^application/x-javascript
</IfModule>

0 comments on commit a67087e

Please sign in to comment.