Skip to content
This repository was archived by the owner on Apr 10, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions test/genconf/nginx.conf.template
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,47 @@ ${

import string
from util import *
import warnings

set_writer(emit)

pagespeed_unsupported = [
"CacheFlushFileName",
"CacheFlushPollIntervalSec",
"CollectRefererStatistics",
"FetchWithGzip",
"FetcherTimeOutMs",
"ForbidAllDisabledFilters",
"ForbidFilters",
"ForceCaching",
"HashRefererStatistics",
"ImageInlineMaxBytes",
"ImgMaxRewritesAtOnce",
"InstallCrashHandler",
"ListOutstandingUrlsOnError",
"LoadFromFile",
"LoadFromFileMatch",
"LoadFromFileRule",
"LoadFromFileRuleMatch",
"MessageBufferSize",
"NumExpensiveRewriteThreads",
"NumRewriteThreads",
"RateLimitBackgroundFetches",
"RefererStatisticsOutputLevel",
"SlurpDirectory",
"SlurpFlushLimit",
"SlurpReadOnly",
"Statistics",
"StatisticsLogging",
"StatisticsLoggingChartsCSS",
"StatisticsLoggingChartsJS",
"StatisticsLoggingFile",
"StatisticsLoggingIntervalMs",
"TestProxy",
"UsePerVHostStatistics",
]


def write_servers_open_item(server, level):
emit_indent("server{\n", level)
emit_indent("listen %s:%s;\n" % (server["address"], server["port"])
Expand Down Expand Up @@ -57,6 +95,9 @@ def write_pagespeed_open(ps, level):
# pagespeed_if is not implemented yet for nginx.
# this code isn't wired up but left in as an example
for key in ps:
if key.lower() in map(str.lower,pagespeed_unsupported):
warnings.warn("%s not supported, skipping" % key)
continue
val = ps[key]
# In pagespeed.debug.conf, the same pagespeed directive can occur
# multiple times. Our pyconf represents that as an array, which we
Expand Down
46 changes: 11 additions & 35 deletions test/genconf/pagespeed.debug.pyconf
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ servers: [
#MEMCACHED MemcachedServers: "localhost:6765",

# TODO(oschaaf): uncomment after this is ported to nginx
#!nginx CacheFlushFilename: "cache.flush",
CacheFlushFilename: "cache.flush",

# If you uncomment this, the test will fail, proving we can disable
# cache-flush polling.
Expand Down Expand Up @@ -854,14 +854,10 @@ servers: [
AvoidRenamingIntrospectiveJavascript: "true",
BeaconUrl: "\"http://example.com/beacon\"",
BlockingRewriteKey: "test",

#!nginx CacheFlushFilename: "/tmp/cache.flush",
#!nginx CacheFlushPollInterevalSec: 10,

CacheFlushFilename: "/tmp/cache.flush",
CacheFlushPollIntervalSec: 10,
ClientDomainRewrite: "false",

#!nginx CollectRefererStatistics: "false",

CollectRefererStatistics: "false",
CombineAcrossPaths: "true",
CssFlattenMaxBytes: 2000,
CssImageInlineMaxBytes: 2000,
Expand All @@ -876,49 +872,39 @@ servers: [
ExperimentSpec: "\"id=8;percent=10\"",
ExperimentVariable: 3,
FetchProxy: "localhost:4321",

#!nginx FetchWithGzip: "on",
#!nginx FetcherTimeOutMs: 1000,

FetchWithGzip: "on",
FetcherTimeOutMs: 1000,
FileCacheCleanIntervalMs: 3600000,
FileCacheInodeLimit: 10000,
FileCachePath: "/tmp/cache/",
FileCacheSizeKb: 1000,
#ifndef nginx
ForbidAllDisabledFilters: "true",
ForbidFilters: "rewrite_images",
ForceCaching: "off",
HashRefererStatistics: "false",
ImageInlineMaxBytes: 2000,
#endif
ImageLimitOptimizedPercent: 80,
ImageLimitResizeAreaPercent: 80,
ImageMaxRewritesAtOnce: 5,
ImageRecompressionQuality: 75,
ImagePreserveURLs: "false",
ImageWebpRecompressionQuality: 85,

#!nginx ImgMaxRewritesAtOnce: 5,

ImgMaxRewritesAtOnce: 5,
## TODO(oschaaf): not availiable in r2338
##InPlaceResourceOptimization: "on",
IncreaseSpeedTracking: "true",

#!nginx InstallCrashHandler: "off",

InstallCrashHandler: "off",
JpegRecompressionQuality: 80,
JsInlineMaxBytes: 2000,
JsOutlineMinBytes: 2000,
JsPreserveURLS: "off",
LRUCacheByteLimit: 1000,
LRUCacheKbPerProcess: 1,
#ifndef nginx
ListOutstandingUrlsOnError: "on",
LoadFromFile: "http://example.com/ /var/html/example/",
LoadFromFileMatch: "\"^http://example.com/\" /var/html/example/",
LoadFromFileRule: "allow /var/html/example/",
LoadFromFileRuleMatch: "Disallow \.php.css$",
#endif
LogRewriteTiming: "false",
LowercaseHtmlNames: "true",
MapOriginDomain: "example.com localhost",
Expand All @@ -928,17 +914,13 @@ servers: [
MaxSegmentLength: 100,
MemcachedServers: "localhost:6765",
MemcachedThreads: 1,

#!nginx MessageBufferSize: 100,

MessageBufferSize: 100,
MinImageSizeLowResolutionBytes: 2000,
ModifyCachingHeaders: "true",
#ifndef nginx
NumExpensiveRewriteThreads: 2,
NumRewriteThreads: 4,
RateLimitBackgroundFetches: "true",
RefererStatisticsOutputLevel: "simple",
#endif
ReportUnloadTime: "true",
RespectVary: "true",
RespectXForwardedProto: "off",
Expand All @@ -948,7 +930,6 @@ servers: [
RunExperiment: "true",
ShardDomain: "example.com 1.example.com,2.example.com",
SharedMemoryLocks: "true",
#ifndef nginx
SlurpDirectory: "/tmp/slurp/",
SlurpFlushLimit: 5,
SlurpReadOnly: "true",
Expand All @@ -958,15 +939,10 @@ servers: [
StatisticsLoggingChartsJS: "\"example.com/js.js\"",
StatisticsLoggingFile: "\"@@MOD_PAGESPEED_STATS_LOG@@\"",
StatisticsLoggingIntervalMs: 3000,
#endif
SupportNoScriptEnabled: "true",

#!nginx TestProxy: "off",

TestProxy: "off",
UrlValuedAttribute: "span src Hyperlink",

#!nginx UsePerVHostStatistics: "on",

UsePerVHostStatistics: "on",
XHeaderValue: "\"test\"",

}
Expand Down